Use arsort(), and while you're in the manual (
http://www.php.net/manual/en/ref.array.php
<http://www.php.net/manual/en/ref.array.php>  ) familiarise yourself with
all the other sort functions (and array functions in general). There's some
useful stuff there that you might not expect, and therefore not look for.

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


        ----------
        From:  Ben Rigby [SMTP:[EMAIL PROTECTED]]
        Sent:  13 August 2001 20:21
        To:  [EMAIL PROTECTED]
        Subject:  problems sorting an associative array...

        hi.
        any help would be mych appreciated!
        i'm trying to sort an associative array, but when i do, the key is
        converted into a number (it should be a string). ie:

        $email_array["[EMAIL PROTECTED]"]=1;
        $email_array["[EMAIL PROTECTED]"]=4;
        $email_array["[EMAIL PROTECTED]"]=10;
        rsort ($email_array);

        i'm trying to sort by the value and then echo out the key and value
        together, but when i do, the key is always a number, rather than the
        email address that i wanted. any ideas??

        thanks,
            ben
        

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to