note 24352 added to control-structures.while
| From: | andrew@php.net | Date: | Tue, 13 Aug 2002 22:00:49 +0000 |
| Subject: | note 24352 added to control-structures.while | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34963@lists.php.net to get a copy of this message | ||
How come:
<?
$yes = array('dog','c.at','snake');
foreach ($yes as $key => $value) while(strchr($value,".")) {
echo "Key: $key, Value: $value<br>\n";
}
?>
Gives me an infinite list of:
Key:1, Value:cat
And not just one time? It just keeps looping? Please help.
--
http://www.php.net/manual/en/control-structures.while.php
http://master.php.net/manage/user-notes.php?action=edit+24352
http://master.php.net/manage/user-notes.php?action=delete+24352
http://master.php.net/manage/user-notes.php?action=reject+24352