Ich hab das Problem jetzt anders gelöst:
Code:
$accept_language = (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : $_ENV['HTTP_ACCEPT_LANGUAGE'];
$accept_languages = explode(',', $accept_language);
foreach ($accept_languages as $accept_language)
{
$accept_language = trim($accept_language);
if (preg_match('#^[a-z]+#i', $accept_language, $match))
{
if (isset($match[0]) && in_array($match[0], $languages))
{
$user_lang = $match[0];
break;
}
}
}