You are here

public static function MobileNumber::getCountryName in Mobile Number 7

Gets the country name a country code.

Parameters

string $country: Country code (Eg. IL).

Return value

int Country display name.

Overrides MobileNumberInterface::getCountryName

3 calls to MobileNumber::getCountryName()
MobileNumber::getCountryOptions in src/MobileNumber.php
Get all supported countries.
MobileNumberClassTestCase::testFunctions in tests/mobile_number.class.test
Test functions.
mobile_number_field_formatter_view in ./mobile_number.module
Implements hook_field_formatter_view().

File

src/MobileNumber.php, line 171

Class

MobileNumber
Class MobileNumber handles mobile number validation and verification.

Code

public static function getCountryName($country) {
  include_once DRUPAL_ROOT . '/includes/locale.inc';
  $drupal_countries = country_get_list();
  return !empty($drupal_countries[$country]) ? $drupal_countries[$country] : '';
}