note 24352 rejected from control-structures.while by maxim
| From: | maxim@php.net | Date: | Tue, 13 Aug 2002 22:08:31 +0000 |
| Subject: | note 24352 rejected from control-structures.while by maxim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-34964@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.