You are here

public static function MobileNumber::getCountryCode in Mobile Number 7

Gets the country phone number prefix given a country code.

Parameters

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

Return value

int Country phone number prefix (Eg. 972).

Overrides MobileNumberInterface::getCountryCode

1 call to MobileNumber::getCountryCode()
MobileNumberClassTestCase::testFunctions in tests/mobile_number.class.test
Test functions.

File

src/MobileNumber.php, line 143

Class

MobileNumber
Class MobileNumber handles mobile number validation and verification.

Code

public static function getCountryCode($country) {
  $libUtil = PhoneNumberUtil::getInstance();
  return $libUtil
    ->getCountryCodeForRegion($country);
}