You are here

public function MobileNumberUtil::getCountryCode in Mobile Number 2.0.x

Same name and namespace in other branches
  1. 8 src/MobileNumberUtil.php \Drupal\mobile_number\MobileNumberUtil::getCountryCode()

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 MobileNumberUtilInterface::getCountryCode

File

src/MobileNumberUtil.php, line 188

Class

MobileNumberUtil
Turns a render array into a HTML string.

Namespace

Drupal\mobile_number

Code

public function getCountryCode($country) {
  return $this->libUtil
    ->getCountryCodeForRegion($country);
}