PHP browser language detection redirect
PHP browser language detection redirect
PHP Browser language detection redirect is simple and straight forward. If you have a multi language website this small script will come handy since you can detect the language of the browser a user is using and determine using which language you should display your webpage to that user.
$language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); echo "The browser language is ".$language; header('Location:language.php?lang=$language');
We are getting this information from the header send by the browser. You can also use this information to redirect a webpage accordingly.
PHP browser language detection redirect,