note 39119 deleted from control-structures.foreach by betz
| From: | betz@php.net | Date: | Sat, 17 Jan 2004 18:44:27 +0000 |
| Subject: | note 39119 deleted from control-structures.foreach by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63745@lists.php.net to get a copy of this message | ||
Note Submitter: Vincent
----
Note that these two pieces of code do exactly the same thing.
<?php
foreach ($array as $key => $val) {
// Do something with $array
}
?>
<?php
reset($array);
while (list($key,$val) = each($array)) {
// Do something with $array
}
?>