[php]
function switchLang($current){
error_reporting(E_ERROR);
//$_SERVER["SCRIPT_URI"]
$pos = strpos($_SERVER["QUERY_STRING"], “lang=”);
$lang_detected = substr($_SERVER["QUERY_STRING"], $pos + 5, 2);
$parts = explode($lang_detected, $_SERVER["QUERY_STRING"]);
($lang_detected == “IT”) ? $lang_detected = “EN” : $lang_detected = “IT”;
(!$parts) ? $parts[0] = “lang=” : “”;
$new_URL = $_SERVER["SCRIPT_URI"] . “?” . $parts[0] . $lang_detected . $parts[1];
//$splitted_URL = preg_split(“/\?/”, $current);
return $new_URL;
}
[/php]
Fico no… se vi interessa questo plugin per WordPress lo trovate qui iG:Syntax Hiliter
0 Responses to “Fermi fermi, devo provarlo”