Fermi fermi, devo provarlo

[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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>