php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #1878 array does not work
Submitted: 1999-07-26 10:11 UTC Modified: 1999-07-26 15:38 UTC
From: frank at freestyling dot de Assigned:
Status: Closed Package: Documentation problem
PHP Version: 3.0.11 OS: freebsd 3.0
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
29 + 24 = ?
Subscribe to this entry?

 
 [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>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-26 15:38 UTC] rasmus at cvs dot php dot net
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"; }
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 23:01:27 2024 UTC