Hello Jeff,

Try:

//---
function DetectBrowserLanguage()
{
        DEF_LANG = 'en';
        global $HTTP_ACCEPT_LANGUAGE;
        $arr_lang = preg_split('/(\s*,\s*)/', $HTTP_ACCEPT_LANGUAGE);
        if (is_array($arr_lang)) {
                $lang_first = strtolower((trim(strval($arr_lang[0]))));
                $lang_first = substr($lang_first, 0, 2);
                $lang = $lang_first;
        } else {
                $lang = DEF_LANG;
        }
        return $lang;
}
//:-)


________________________

Best regards,
 Nenad Djordjevic                           mailto:[EMAIL PROTECTED]
   
   Diyomi Soft
   http://www.diyomisoft.com/


Tuesday, December 17, 2002, 6:51:19 PM, you wrote:

J> Does anybody know how to get what language (en, fr, it, etc.) the users
J> browser is using?

J> Jeff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to