note 38659 added to control-structures.foreach
| From: | endofyourself at yahoo dot com | Date: | Thu, 01 Jan 2004 20:36:03 +0000 |
| Subject: | note 38659 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-62759@lists.php.net to get a copy of this message | ||
If you are trying to do something like:
<?PHP
foreach(
$someArray1 as $someValue1 ,
$someArray2 as $someValue2
) {
echo $someValue1;
echo $someValue2;
}
?>
Pleas note that this IS NOT possible (although it would be cool). However, here is another way to
acheive a similar effect:
<?PHP
for(
;
list(, $someValue1 ) = each( $someArray1 ) ,
list(, $someValue2 ) = each( $someArray2 )
;
) {
echo $someValue1;
echo $someValue2;
}
?>
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38659
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38659&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38659&report=yes
Search -- http://master.php.net/manage/user-notes.php