Created
March 16, 2011 10:05
-
-
Save maximevalette/872273 to your computer and use it in GitHub Desktop.
Retourne la langue préférée du navigateur.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Retourne la langue préférée du navigateur. | |
* | |
* @return string | |
*/ | |
function getLanguage() { | |
$langs = explode(";", $_SERVER['HTTP_ACCEPT_LANGUAGE']); | |
$langs = explode(",", $langs[0]); | |
return $langs[0]; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment