PHP - To detect browser language

by barkkathulla 2014-03-29 11:36:30

To detect Browser language:

$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
switch ($lang){
case "fr":
/*** include ur checks .....***/
break;
case "it":
/*** include ur checks .....***/
break;
case "en":
/*** include ur checks .....***/
break;

etc.....

default:
//include EN in all other cases of different lang detection
break;
}
?>

628
like
0
dislike
0
mail
flag

You must LOGIN to add comments