is too much for me as newbie. Isn’t there any simple function for this? Maybe there is better method but I try with this but can’t get it to work
$test=array("se","en;q=0.7","da;q=0.3");
foreach ($test as $value) {
$b = strstr($value, ';', TRUE );
if ($b == "en")
{
echo "uuuuuuuuuu";
}
}
If I add "en" in if-statement then echo prints out without everything after it, but if its only "se" for example (in array) and "se" in if-statement, then it not work.
Is it better or easier somehow format that string before make array of that string? What I am try to do is format string from $string = ($_SERVER["HTTP_ACCEPT_LANGUAGE"]);. IE and FF print out like: sv-SE,en;q=0.7,da;q=0.3 if there is more than one language in "browser language list".