Created
March 12, 2016 13:08
-
-
Save Hexodus/881b08dc2288ca5ea9ad to your computer and use it in GitHub Desktop.
Extracts the browser language. Returns the first two letters i.e.: de, en, fr
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
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); | |
echo $lang; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment