note 52430 added to function.list
| From: | ceo at l-i-e dot com | Date: | Sun, 01 May 2005 00:38:38 +0000 |
| Subject: | note 52430 added to function.list | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88802@lists.php.net to get a copy of this message | ||
I dunno what the documentation is trying to say when it says "list only works with numerical
indices" but it's patently false:
php -a
<?php
$foo = array('a'=>'apple', 'b'=>'banana',
'c'=>'coconut');
while (list($k, $v) = each($foo)){
echo "$k: $v\n";
}
?>
Content-type: text/html
X-Powered-By: PHP/4.3.11
a: apple
b: banana
c: coconut
It has worked just fine with alpha indices since PHP 3.0rc2, at a minimum, cuz I've been doing
it that long.
----
Manual Page -- http://www.php.net/manual/en/function.list.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52430
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52430&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52430&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52430&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52430&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52430&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52430&report=yes
Search -- http://master.php.net/manage/user-notes.php