note 35599 deleted from function.each by vincent
| From: | vincent@php.net | Date: | Mon, 08 Sep 2003 14:24:33 +0000 |
| Subject: | note 35599 deleted from function.each by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55799@lists.php.net to get a copy of this message | ||
Note Submitter: mark@kennel17.co.uk
----
In response to wvdmark at computer dot org this is expected behaviour of the while statement. Any
function in the head of the loop will be evaluated on each iteration and therefore, in your example,
explode will always create the same new array. Your example should be rewritten:
$arr = explode(',',$data);
while (list($key,$value) = each($arr))