-
☆ A M B ☆
- 24,524 Posts
The sort and asort functions do not return the sorted array, they sort the actual array. They return a boolean value for success or failure.
It's returning 0 because you are loading the array incorrectly. Try this:
<?php
$myarray = array("jim", "terry", "bob");
asort($myarray);
print_r($myarray);
http://php.net/manual/en/language.types.array.php
An existing array can be modified by explicitly setting values in it.
This is done by assigning values to the array, specifying the key in brackets. The key can also be omitted, resulting in an empty pair of brackets ([]).
[ed. note: sottwell last edited this post 13 years, 11 months ago.]