public function getCountryCodeByName($name)
    {
        if (isset($this->countryList[$name])) {
            return $this->countryList[$name];
        }

        //nothing found we try case insensitive
        $name = strtolower($name);
        foreach ($this->countryList as $countryName => $countryCode) {
            if (strtolower($countryName) == $name) {
                return $countryCode;
            }
        }

        return null;
    }
public function getCountryCodeByName($name)
    {
        if (isset($this->countryList[$name])) {
            return $this->countryList[$name];
        }

        //nothing found we try case insensitive
        $name = strtolower($name);
        foreach ($this->countryList as $countryName => $countryCode) {
            if (strtolower($countryName) == $name) {
                return $countryCode;
            }
        }

        return null;
    }
public function getCountryCodeByName ( $ name ) { if ( isset ( $ this -> countryList [ $ name ] ) ) { return $ this -> countryList [ $ name ] ; } //nothing found we try case insensitive $ name = strtolower ( $ name ) ; foreach ( $ this -> countryList as $ countryName => $ countryCode ) { if ( strtolower ( $ countryName ) == $ name ) { return $ countryCode ; } } return null ; }
Get the country code by country name

@param string $name
@return null|string
Get the country code by country name