Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- sorting array...i
November 20, 2007, 3:32 pm
rate this thread
Re: sorting array...i
poorly asked question.
sort() performs a sort on the $array parameter by reference. sort() does NOT
return the sorted version of $array as a result of its operation. so...
$array = array(
echo '<pre>' . print_r($array, true) . '</pre>';
will print the array and show that the values are sorted from lowest to
btw, leave out the array(5) string(2) => shit. it makes reading the code
a pain in the ass and isn't needed in the least...it doesn't make any impact
on the way php executes that code. if coded like the above, you can easily
see what *actual* values are making up the members of the array...rather
than trying to weed out the other junk surrounding them (like what index it
has or what data-type you are *casting* it to). the extra crap is feckless
and less than useful.