Hi.
Im working on a script that spells out the location of the visitor, using "$HTTP_ACCEPT_LANGUAGE". Im currently using if/elseif/else to add each countrycode to the script and make it print out the countryname.
example: (this is the include file)
$lang = "$HTTP_ACCEPT_LANGUAGE";
if ($lang == sv) {
$lang_message = "sweden";
} elseif ($lang == da) {
$lang_message = "denmark";
} else {
$lang_message = "$HTTP_ACCEPT_LANGUAGE";
}
and this calls the script:
<?echo $lang_message?>
Now to my question:
Instead of making the biggest if/elseif/else script the world will ever see, is there a better way to do this?
Im aiming at covering all the available countrycodes. (i can hear laughter already...)
Oh... btw.. did i mention that I'm a n00b and that this is my first script-attempt? 🙂