Alcohol\ISO3166\ISO3166::getByAlpha2 PHP Method

getByAlpha2() public method

Lookup ISO3166-1 data by alpha2 identifier.
public getByAlpha2 ( string $alpha2 ) : array
$alpha2 string
return array
    public function getByAlpha2($alpha2)
    {
        if (!preg_match('/^[a-zA-Z]{2}$/', $alpha2)) {
            throw new \DomainException('Not a valid alpha2: ' . $alpha2);
        }
        return $this->get($alpha2);
    }