problems sorting an array
From: Jochen Califice (mail_at_boomboxx.de)
Date: 03/30/05
- Next message: Daniel Tryba: "Re: problems sorting an array"
- Previous message: Martijn: "function aliases"
- Next in thread: Daniel Tryba: "Re: problems sorting an array"
- Reply: Daniel Tryba: "Re: problems sorting an array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 30 Mar 2005 13:06:06 +0200
hello ng!
got a problem sorting my multi-dimensional array. I have the following
situation of an array:
$fahrzeugarray[0]["fzid"]= "23"
$fahrzeugarray[0]["fzname"]="Audi TT"
$fahrzeugarray[1]["fzid"]= "34"
$fahrzeugarray[1]["fzname"]="VW Polo 1.2"
$fahrzeugarray[2]["fzid"]= "57"
$fahrzeugarray[2]["fzname"]="BMW Z3"
now i need to sort the array by 'fzname' before showing it. got to create
<SELECT> list with the 'fzid' as value and 'fzname' as text.
I use the following code to handle that but it doesn't work:
---------------------------------------------------------------------------------------
array_multisort($fahrzeugarray["fzname"]);
foreach($fahrzeugarray as $show_fza)
{
echo "<option
value='".$show_fza["fzid"]."'>".$show_fza["fzname"]."</option>";
}
---------------------------------------------------------------------------------------
when i start the script it shows the list without sorting it before. that's
a problem i try to solve sonce hours.
perhaps some one got an idea what is wrong with my script? :)
many thanks!
Jochen
- Next message: Daniel Tryba: "Re: problems sorting an array"
- Previous message: Martijn: "function aliases"
- Next in thread: Daniel Tryba: "Re: problems sorting an array"
- Reply: Daniel Tryba: "Re: problems sorting an array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|