[PHP] Sort Array not working

2007-01-09 Thread Kevin Murphy
I'm having trouble sorting an array. When I do, it empties the array for some reason. Take the following code: $data = bird,dog,cat,dog,,horse,bird,bird,bird,lizard; $array = explode(,,$data); // Create the array $array = array_diff($array, array()); // Drop the empty

Re: [PHP] Sort Array not working

2007-01-09 Thread Fredrik Thunberg
Hi sort returns a bool, the sorted array passed by reference. So try: $result = sort( $array ); //Now $array is sorted print_r( $array ); /Fredrik Thunberg Kevin Murphy skrev: I'm having trouble sorting an array. When I do, it empties the array for some reason. Take the following code:

[PHP] Re: SOLVED: [PHP] Sort Array not working

2007-01-09 Thread Kevin Murphy
Once you see it in email, sometimes the obvious jumps out at you. Fixed this on my own. -- Kevin Murphy Webmaster: Information and Marketing Services Western Nevada Community College www.wncc.edu 775-445-3326 On Jan 9, 2007, at 10:41 AM, Kevin Murphy wrote: I'm having trouble sorting an