note 81459 added to control-structures.foreach
| From: | marian at devourmedia dot com | Date: | Fri, 29 Feb 2008 01:34:00 +0000 |
| Subject: | note 81459 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136580@lists.php.net to get a copy of this message | ||
Also, do not forget that foreach is not useful
if you change the value inside of the loop.
For example:
$t=array('a', 'a', 'a', 'a', 'a', 'a',
'a', '1', 'a', 'a', 'a', 'a',
'a');
foreach($t as $var=>$val)
{
$t=array();
echo "val={$val}<br>";
}
is still showing the contents of the array $t.
----
Server IP: 69.147.83.197
Probable Submitter: 82.76.115.71
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/81459
Del: integrated -- https://master.php.net/note/delete/81459/integrated
Del: useless -- https://master.php.net/note/delete/81459/useless
Del: bad code -- https://master.php.net/note/delete/81459/bad+code
Del: spam -- https://master.php.net/note/delete/81459/spam
Del: non-english -- https://master.php.net/note/delete/81459/non-english
Del: in docs -- https://master.php.net/note/delete/81459/in+docs
Del: other reasons-- https://master.php.net/note/delete/81459
Reject -- https://master.php.net/note/reject/81459
Search -- https://master.php.net/manage/user-notes.php