problems sorting an array

From: Jochen Califice (mail_at_boomboxx.de)
Date: 03/30/05


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



Relevant Pages

  • Re: problems sorting an array
    ... > now i need to sort the array by 'fzname' before showing it. ... > when i start the script it shows the list without sorting it before. ...
    (comp.lang.php)
  • Re: Logon script - function array and select case not working
    ... this all works well, except, the function i am using for the rules in the control script causes alot of querrys to AD. as there are alot of groups. ... objTSout.writeline retrv ... So if you think that this will assign an array value to the variable, how do you think the case select statement is going go compare this array value with the literal string values such as "group name here"? ... However, by not assigning ANY value to checkgrp in the function, you are guaranteeing that, should the function ever exit, it will return no information. ...
    (microsoft.public.scripting.vbscript)
  • Re: string retrieval issue
    ... Chicago Bears|NFC North ... not writing the third element back to the array). ... You didn't include it in your script. ... Fear is the mind-killer. ...
    (comp.lang.perl.misc)
  • Re: even rows for checkbox forms with no splitting of boxes from values
    ... 'mod' on the array length with a denominator equal to the width of the row, ... State saving really depends on what the script is already doing. ... So I usually roll my own checkboxes. ... #this is to create an array with 25-50 strings 2-10 in length ...
    (comp.infosystems.www.authoring.cgi)
  • Re: settimeout needs alert() ???
    ... function slider { ... and use script to replace the src and title attributes. ... are downloaded completely. ... The usual strategy is to load all of the images in to an array of image ...
    (comp.lang.javascript)