Skip to content

Instantly share code, notes, and snippets.

@flowtwo
Created October 11, 2013 18:41
Show Gist options
  • Save flowtwo/6939891 to your computer and use it in GitHub Desktop.
Save flowtwo/6939891 to your computer and use it in GitHub Desktop.
This checks browser language and returns its prefix.
/**
* 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