note 10334 added to list
| From: | rubein at earthlink dot net | Date: | Thu, 28 Dec 2000 22:15:37 +0000 |
| Subject: | note 10334 added to list | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9161@lists.php.net to get a copy of this message | ||
Note: If you have an array full of arrays, you can't use list() in conjunction to foreach()
when traversing said array, e.g.
$someArray = array(
array(1, "one"),
array(2, "two"),
array(3, "three")
);
foreach($somearray as list($num, $text)) { ... }
This, however will work
foreach($somearray as $subarray) {
list($num, $text) = $subarray;
...
}
http://www.php.net/manual/function.list.php