Documentation - phpLocale Web Site

 
//instantiate Locale_Negotiator
$negotiator     =& new Locale_Negotiator();

//define which language[s] your site supports :: optional
$supportLangs = array('fr','jp');

//find first matched language
$lang           =  $negotiator->getLanguageMatch($supportedLangs);

//define which countries your site supports :: optional
$supportCountries = array('gb','us');

//find first matched Country
$countryCode = $negotiator->getCountryMatch($lang,$supportCountries);

echo 'Language Code: '.$lang.'
Language Name: '.$negotiator->getLanguageName($lang).'
Country Code: '.$countryCode.'
Country Name: '.$negotiator->getCountryName($countryCode);
Back
SourceForge Logo © All Rights reserved. Naoki Shima. 2001.