You are here

function countries_sort in Countries 7.2

Same name and namespace in other branches
  1. 8 countries.module \countries_sort()

A helper uasort callback function to sort an array of countries or names.

4 string references to 'countries_sort'
CountriesFunctionsUnitTest::testCountriesSort in tests/countries.test
This test that the country sort works.
countries_get_continents in ./countries.module
Gets a list of all continents currently enabled.
countries_get_countries in ./countries.module
Helper function to load countries. This includes all countries by default.
views_handler_filter_countries_list::get_value_options in views/views_handler_filter_countries_list.inc
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.

File

./countries.module, line 617
Defines the field and entity information for countries.

Code

function countries_sort($a, $b) {
  $a = countries_transliterate(is_object($a) ? $a->name : $a);
  $b = countries_transliterate(is_object($b) ? $b->name : $b);
  return strnatcasecmp($a, $b);
}