public function isValidLocale($locale)
    {
        $locale = strtoupper($locale);
        if (substr_count($locale, '_')) {
            $locale = substr($locale, strpos($locale, '_') + 1);
        }

        if (substr_count($locale, '-')) {
            $locale = substr($locale, strpos($locale, '-') + 1);
        }

        return in_array($locale, $this->countryList);
    }
public function isValidLocale($locale)
    {
        $locale = strtoupper($locale);
        if (substr_count($locale, '_')) {
            $locale = substr($locale, strpos($locale, '_') + 1);
        }

        if (substr_count($locale, '-')) {
            $locale = substr($locale, strpos($locale, '-') + 1);
        }

        return in_array($locale, $this->countryList);
    }
public function isValidLocale ( $ locale ) { $ locale = strtoupper ( $ locale ) ; if ( substr_count ( $ locale , '_' ) ) { $ locale = substr ( $ locale , strpos ( $ locale , '_' ) + 1 ) ; } if ( substr_count ( $ locale , '-' ) ) { $ locale = substr ( $ locale , strpos ( $ locale , '-' ) + 1 ) ; } return in_array ( $ locale , $ this -> countryList ) ; }
return true if the locale is valid

@param string $locale
@return bool
return true if the locale is valid