PHP Classes

Language Detector: Detect the preferred language of the user

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-11-25 (6 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 387 All time: 6,116 This week: 1,182Up
Version License PHP version Categories  
language-detector 2.1.0Free To Use But R...5.0Localization, HTTP, PHP 5
Description Author  

This class can detect the preferred language of the user accessing the site.

It can look at the HTTP request accept header and determine the preferred language of the user from a list of supported languages.

The detected language can fallback to a language associated to the user country in case the Accept header is not sent by the browser.

The detected language can be stored in a cookie to avoid needing to detect the language again in subsequent requests.

Picture of Peter Kahl
Name: Peter Kahl <contact>
Classes: 5 packages by
Country: Hong Kong Hong Kong
Age: ???
All time rank: 11725 in Hong Kong Hong Kong
Week rank: 365 Up1 in Hong Kong Hong Kong Up
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Plain text file class.language-detector.php Class Class
Plain text file example-1.php Example Simple application, instructions.
Plain text file example-2.php Example Shows practical application on web page.
Plain text file Doc. Readme

 Version Control Unique User Downloads Download Rankings  
 0%Total:387All time:6,116
 This week:0This week:1,182Up