Created
October 11, 2013 18:41
-
-
Save flowtwo/6939891 to your computer and use it in GitHub Desktop.
This checks browser language and returns its prefix.
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
/** | |
* Browser language | |
*/ | |
if ( !function_exists('gr_language') ) { | |
function gr_language() { | |
$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