Reshuffling an array
| From: | Todd Cary | Date: | Wed, 12 May 2004 18:01:18 +0000 |
| Subject: | Reshuffling an array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-186026@lists.php.net to get a copy of this message | ||
I do the following:
$eventList = array();
$eventList[] = "Any";
$dbh = db_open($host, $user, $password, $database);
if($dbh) {
$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