PHP Source Code

localeDetection.class.php

Demo

Visitors accept lang headers:

string(28) "en-us,en-gb,en;q=0.7,*;q=0.3"

Locales supported on the site:

array(5) { [0]=> string(5) "es-ES" [1]=> string(5) "en-US" [3]=> string(2) "fr" [4]=> string(5) "ga-IE" [5]=> string(2) "ru" }

The default locale is:

string(2) "ru"

The chosen locale for the visitor is:

string(5) "en-US"