<?php
if(count($_GET)){
foreach ($_GET as $key=>$value){
$str.=$key.”=”.$value.”&”;
}
$str=substr($str,0,-1);
echo “http://”.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].”?”.$str;
}else{
echo “http://”.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
}
?>
···
···