I need a way to include a php file based on the language in the URL. Right now this script is working, but when I have 10 or 20 languages I would like some sort of shorter script, that still contains the same information. The thing is, if the ‘lg’ in the URL is changed to a language that doesn’t exist, I would like to use the english language.
$langue=$_GET['lg'];
if ($langue == "da")
{ include"da.php";}
elseif ($langue == "de")
{ include"de.php";}
elseif ($langue == "en")
{ include"en.php";}
elseif ($langue == "es")
{ include"es.php";}
else { include"en.php";}
Anybody who can shorten this one?
1 Answer