note 81459 deleted from control-structures.foreach by googleguy
| From: | googleguy@php.net | Date: | Wed, 14 Nov 2012 22:30:40 +0000 |
| Subject: | note 81459 deleted from control-structures.foreach by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191971@lists.php.net to get a copy of this message | ||
Note Submitter: marian at devourmedia dot com
----
Also, do not forget that foreach is not useful
if you change the value inside of the loop.
For example:
<?php
$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.