Re: While on array?

From: Date: Mon, 21 Jan 2002 02:05:58 +0000
Subject: Re: While on array?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-81308@lists.php.net to get a copy of this message
You should probably take a look at each() for that... The functionality is not the same but it's the only answer I can think of for your question (i.e. mysql_fetch_row() _returns_ a key-value array while each() _walks_ a key-value array). Bogdan Daniel Alsén wrote: > Hi, > > i am fiddling with a script and need to change a while-loop from running on > mysql_fetch_array to a "normal" array? > > ie - i have: > while($myrow=mysql_fetch_array($result)) { etc... > > But i want the loop to run with an array i created earlier ($anotherarray = > [key1] => value1, [key2] => value2). > > How would i do that? Does the loop behave the same way - running until the > array is out of data? > > Thanks! > # Daniel Alsén | www.mindbash.com # > # d@mindbash.com | +46 704 86 14 92 # > # ICQ: 63006462 | +46 8 694 82 22 # > # PGP: http://www.mindbash.com/pgp/ # > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#81308) next »