Re: Reshuffling an array
| From: | Justin Patrin | Date: | Wed, 12 May 2004 18:13:56 +0000 |
| Subject: | Re: Reshuffling an array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186028@lists.php.net to get a copy of this message | ||
Todd Cary wrote:
I do the following: $eventList = array(); $eventList[] = "Any"; $dbh = db_open($host, $user, $password, $database); if($dbh) {Take out the $eventList[] = "Any"; at the top and at the bottom: array_unshift($eventList, 'Any'); -- paperCrane <Justin Patrin>$sthdl = db_get_event_data($dbh); while ($row = mysql_fetch_object($sthdl)) { $eventList[] = $row->EV_EVENT; }} else {$eventList[] = "* None found *";} asort( $eventList ); Now I want to put "Any" as the first item. What is the best way to do this? Often the sort puts it as an item down the list. Todd