rgb192
asked on
echo an array in alphabetical order
given an array
$organization
bob real estate
susan real estate
mary apartments
edward locators
echo this array in alphabetical order
$organization
bob real estate
susan real estate
mary apartments
edward locators
echo this array in alphabetical order
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Consider this variation on the theme:
$string='$organization
bob real estate
susan real estate
Mary apartments
edward locators';
When the sort fails because the data has capitalization, please post a new question. We can help with that.
In that case you just use
usort($string_arr, 'strnatcasecmp');
ASKER
alpha sort works