freephoneid Posted December 9, 2008 Share Posted December 9, 2008 Hi, I want to detect the browser language. How can I do that in PHP? Basically, if I change the brower setting to "Ja" (japanese), then the code should print Japanese as output. If I change browser setting to German, code should print German. Can any one tell me how to do it? Thanks in Advance!! Link to comment https://forums.phpfreaks.com/topic/136279-detect-browser-language/ Share on other sites More sharing options...
trq Posted December 9, 2008 Share Posted December 9, 2008 May not exist depending on the client, but you could take a look at $_SERVER['HTTP_ACCEPT_LANGUAGE']. Link to comment https://forums.phpfreaks.com/topic/136279-detect-browser-language/#findComment-710942 Share on other sites More sharing options...
freephoneid Posted December 10, 2008 Author Share Posted December 10, 2008 Well, I tried that but it shows all the languages set in the browser. What I want is the languages selected by the user at the top in the browser. How can I detect that? Link to comment https://forums.phpfreaks.com/topic/136279-detect-browser-language/#findComment-710946 Share on other sites More sharing options...
trq Posted December 10, 2008 Share Posted December 10, 2008 PHP runs on the server so isn't really capable of this. You'll want to look into something client side like Javascript. Link to comment https://forums.phpfreaks.com/topic/136279-detect-browser-language/#findComment-711062 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.