problems sorting an array

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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:

   foreach($fahrzeugarray as $show_fza)
      echo "<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!


Re: problems sorting an array

Quoted text here. Click to load it

You read the manual page of array_multisort? It doesn't do what you
want, see example 2.

Site Timeline