function phone_countries in Phone 7
Same name and namespace in other branches
- 7.2 phone.module \phone_countries()
Function which holds an array of supported countries.
Parameters
string $countrycode:
Return value
boolean Returns the whole array of countries $countrycode isn't specified and a country name for when it is specified.
3 calls to phone_countries()
- phone_country_info in ./
phone.module - Get a country meta info
- phone_field_presave in ./
phone.module - Implements hook_field_presave().
- phone_field_settings_form in ./
phone.module - Implements hook_field_settings_form().
File
- ./
phone.module, line 9
Code
function phone_countries($code = NULL) {
static $countries;
if (!isset($countries)) {
$countries = array(
'fr' => 'France',
'be' => 'Belgium',
'it' => 'Italy',
'el' => 'Greece',
'ch' => 'Switzerland',
'ca' => 'US & Canada',
'cr' => 'Costa Rica',
'pa' => 'Panama',
'gb' => 'Great Britain - United Kingdom',
'ru' => 'Russia',
'ua' => 'Ukraine',
'es' => 'Spain',
'au' => 'Australia',
'cs' => 'Czech Republic',
'hu' => 'Hungary',
'pl' => 'Poland - mobiles only',
'nl' => 'Netherland',
'se' => 'Sweden',
'za' => 'South Africa',
'il' => 'Israel',
'nz' => 'New Zealand',
'br' => 'Brazil',
'cl' => 'Chile',
'cn' => 'China',
'hk' => 'Hong-Kong',
'mo' => 'Macao',
'ph' => 'The Philippines',
'sg' => 'Singapore',
'sn' => 'Senegal',
'jo' => 'Jordan',
'eg' => 'Egypt',
'pk' => 'Pakistan',
'int' => 'International Phone Numbers per E.123',
);
}
return $code === NULL ? $countries : (isset($countries[$code]) ? $countries[$code] : NULL);
}