Re: Nested foreach ?

From: Date: Sun, 17 Oct 2004 20:18:54 +0000
Subject: Re: Nested foreach ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199679@lists.php.net to get a copy of this message
Stuart Felenstein wrote:
Here is the printout : Using- print_r ($skills); print_r ($skys); print_r ($slus); Array ( [0] => skillone [1] => skilltwo [2] => skillthree [3] => [4] => ) Array ( [0] => 2 [1] => 3 [2] => 4 [3] => [4] => ) Array ( [0] => [1] => [2] => [3] => [4] => ) 1 FYI - The skills is a string, skys and slus ints. Also I had only filled in 3 of the 5 for each.
Since we're just guessing at what you want, I'll guess something like this: foreach($skills as $key => $skill) { echo "$skill - {$skys[$key]} - {$slus[$key]}\n"; } -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#199679) next »