function MakeUrl($arr){
foreach($arr as $key=>$value){
$url[]=$key."_".$value;
}
$tmpurl=implode("_",$url);
return $tmpurl.".htm";
}
function ParseUrl(){
if($_SERVER['PATH_INFO']!=""){
$pathinfo=substr($_SERVER['PATH_INFO'],1);
$pathinfo=str_replace(".htm","",$pathinfo);
$path=explode("_",$pathinfo);
$count=count($path);
for($i=0;$i<$count;$i+=2){
$_GET[$path[$i]]=$path[$i+1];
}
}
}
//使用实例,连接页面
$path="http://www.dayanmei.com/blog.php/";
$path.=MakeUrl(array('BlogID'=>2,'page'=>1));
//浏览页面,调用函数ParseUrl();直接可使用变量$_GET
php