note 91603 added to control-structures.foreach
| From: | anon at manhattaninteractive dot com | Date: | Fri, 19 Jun 2009 00:58:59 +0000 |
| Subject: | note 91603 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157108@lists.php.net to get a copy of this message | ||
Note that:
foreach($array as $value){
if($result=='problem'){
prev($array);
}
}
wont work. if you need to rewind the pointer in a foreach loop for some reason use the alternate:
while (list(, $value) = each($array)) {
if($result=='problem'){
prev($array);
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 98.248.58.74
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/91603
Del: integrated -- https://master.php.net/note/delete/91603/integrated
Del: useless -- https://master.php.net/note/delete/91603/useless
Del: bad code -- https://master.php.net/note/delete/91603/bad+code
Del: spam -- https://master.php.net/note/delete/91603/spam
Del: non-english -- https://master.php.net/note/delete/91603/non-english
Del: in docs -- https://master.php.net/note/delete/91603/in+docs
Del: other reasons-- https://master.php.net/note/delete/91603
Reject -- https://master.php.net/note/reject/91603
Search -- https://master.php.net/manage/user-notes.php