Link to home
Start Free TrialLog in
Avatar of nicky2k
nicky2kFlag for United Kingdom of Great Britain and Northern Ireland

asked on

PHP getlocale help, very easy points

I've just been on www.php.net and this is still as clear as mud to me.

What I want to do is process code depending on the current user locale. I can't seem to find a function that does this.
If locale = "Europe/London" then
  do code 1
Else if locale = "USA"
  do code 2
Else if locale="Africa"
  do code 3

Thanks.
Avatar of shobinsun
shobinsun
Flag of India image

Hi,

Use the server variable:

$_SERVER['HTTP_ACCEPT_LANGUAGE']

For testing:

echo $_SERVER['HTTP_ACCEPT_LANGUAGE'];
Avatar of nicky2k

ASKER

That just gets me the languages though, which could be used by any country. WhatI need is the timezone or country name itself.
ASKER CERTIFIED SOLUTION
Avatar of shobinsun
shobinsun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial