PHP Sort an array alphabetically except ONE value on top, for a dropdown menu
问题 I am trying to hack a dropdown menu pulling info from an array of countries so that 'United States' (id 1) appears on the top, while every other country is sorted by alphabetical order. How do I sort all EXCEPT United States to remain on top, using usort function for an array? Any alternative suggestions are also welcome. Here is the code: while (list($key, $value) = each($countries->countries)) { $countries_array[] = array('id' => $key, 'text' => $value['countryname']); } function text_cmp(