if (empty($_SESSION['lang'])) {
preg_match('/^\w{2}/',$_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches);
switch (strtolower($matches[0])){
case "ru":
$_SESSION['lang']="ru";
break;
case "en":
case "uk":
case "us":
default:
$_SESSION['lang']="en";
break;
}
}
require_once './lang/' . $_SESSION['lang'] . '.php';