|
Posted by Mladen Gogala on 06/25/05 08:00
On Fri, 24 Jun 2005 15:11:16 -0700, David Winter wrote:
> <?php
> echo "$HTTP_ACCEPT_LANGUAGE";
> ?>
>
> does work, i.e. it shows the correct Language Code.
How about putting one echo "$userlang\n"; or var_dump($userlang);
after you set $userlang? You are not testing $HTTP_ACCEPT_LANGUAGE,
you are testing variable $userlang=substr($HTTP_ACCEPT_LANGUAGE,0,2);
PHP5 distinguishes uppercase from lowercase. Try with:
$userlang=strtoupper(substr($HTTP_ACCEPT_LANGUAGE,0,2));
Language codes are formated like this:
$ echo $LANG
en_US
What you will get from your code is "en" which isn't the same as "EN".
--
You can get more of what you want with a kind word and a gun than
you can with just a kind word. (Al Kapone)
[Back to original message]
|