Just build an assosciative array like so
$arr["person1"] = "string1";
$arr["person2"] = "string2";
$arr["person3"] = "string3";
$arr = asort($arr);
this should do what you're looking for.
Gfunk - http://www.gfunk007.com/
I sense much beer in you. Beer leads to intoxication, intoxication to
hangovers, and hangovers to... suffering.
----- Original Message -----
From: "Ray Iftikhar" <[EMAIL PROTECTED]>
To: "Php-General List" <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 2:52 PM
Subject: [PHP] [php] - alphabetizing
> Hello,
> I was just typing a msg and accidentally hit send before I could
> finish.. sorry..
>
> I have a file, its contents are as follows:
>
> Name of person1, string1
> Name of person2, string2
> Name of person3, string3
> Name of person4, string4
> Name of person5, string5
>
> I want to alphabetize the list from A-Z (using the first column as the
> primer key). I was planng on using an array, but I would have to use a 2
> dimensional array and I am not too swift on those..
>
> Thanx,
> Ray..
>
>
> --
> 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]
>
--
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]