I use this to set language session for navigation. Someone said that this switch is too cumbersome. Why? Is there an easier way?
$defaultLang = 'it';
if (!empty($_GET["lang"])) {
switch (strtolower($_GET["lang"])) {
case "en":
$_SESSION['lang'] = 'gb';
break;
case "tr":
$_SESSION['lang'] = 'tr';
break;
default:
$_SESSION['lang'] = $defaultLang;
break;
}
}
if (empty($_SESSION["lang"])) {
$_SESSION["lang"] = $defaultLang;
}