Tips & Tricks »

I was looking for a simple way to automatically detect a users language using PHP and came across this interesting snippet which does just that. It uses the PHP superglobal ‘HTTP_ACCEPT_LANGUAGE’ which returns something like this for me “en-US,en;q=0.8″. This is the contents language code of the header from the current request, if there is one...
Posted by girish.r 715 days ago (http://papermashup.com)
Discuss  | Bury | Tweet This | Tagged: php language detection
Add To 

Who Voted for this Story

Comments

No one has commented on this article yet.

Log in to comment or register here.