|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-07-26 10:11 UTC] frank at freestyling dot de
$fruits = array("lemon","orange","banana","apple");
sort($fruits);
for(reset($fruits); $key = key($fruits); next($fruits)) {
echo "fruits[$key] = ".$fruits[$key]."\n";
}
does not work !!!!
there is no ouput !!!
++ plus
the FAQ on www.php3.de is not correctly displayed
<b>Fatal error</b>: Call to unsupported or undefined function set_magic_quotes_runtime() in <b>/home/pages/php3.de/phpweb/FAQ.php3</b> on line <b>9</b><br>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 23:00:01 2025 UTC |
The key of the first array element will be 0 and thus your condition for looping will be false. Use: while(list($key,$value)=each($fruits)) { echo "fruits[$key] = ".$value."\n"; }