PHP Code:
function getlang($enlang)
{
$lango = explode(",", $enlang);
$langos = str_replace("", "", $lango[0]);
$lang = "$langos[0]$langos[1]";
return $lang;
}
$mylang = getlang($_SERVER['HTTP_ACCEPT_LANGUAGE']);
echo "Your language is: $mylang<br />";
PHP Code:
<?php
session_start();
$getlang = getlang($_SERVER['HTTP_ACCEPT_LANGUAGE']);
if ($getlang=="de")
{
$_SESSION['lang'] == "de";
echo "<b>You will be Redirected in 5 seconds to the site version which suits your Language</b><br />";
echo "<meta http-equiv=\"refresh\" content=\"5; url=german.html\">";
}
else
{
$_SESSION['lang'] == "en";
echo "<b>You will be Redirected in 5 seconds to the site version which suits your Language</b><br />";
echo "<meta http-equiv=\"refresh\" content=\"5; url=english.html\">";
}
?>