I have an array that lloks like this:

$languages = array(
   "af"  => array("Afrikaans", "Afrikaans", "South Africa"),
   "sq"  => array("Albanian", "Shqipe", "Albania")        );


Now, if the user's $_HTTP_ACCEPT_LANGUAGE contains, for example, "af",
I want to print the third value of the subarray for that value. This
code would not work, naturally, as I'm doing it wrong. I have been
unable to google a working example. Could someone please show me what
I'm doing wrong:

foreach ($languages as $language){
   if (  strstr( $_HTTP_ACCEPT_LANGUAGE, $language)  ) {
       print"<center>You are from ".$language[2]."!</center>";
   }
}

Thank in advance for any assistance.

Dotan Cohen

http://lyricslist.com/
http://what-is-what.com/

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

Reply via email to