Code:
<?php
function mod_rewrite(){
global $_GET;
//$nav=$_SERVER["REQUEST_URI"];
$nav = '/129244/index.html';
//$script_name=$_SERVER["SCRIPT_NAME"];
$script_name = '/index.html';
$nav=substr(ereg_replace("^$script_name","",urldecode($nav)),1);
$nav=preg_replace("/^.ht(m){1}(l){0,1}$/","",$nav);//这句是去掉尾部的.html或.htm
$vars = explode("/",$nav);
for($i=0;$i<Count($vars);$i+=2){
$_GET["$vars[$i]"]=$vars[$i+1];
}
return $_GET;
}
$aa = mod_rewrite();
var_dump($aa);
echo '<br>';
var_dump($_SERVER["REQUEST_URI"]);
?>
这样看就明白了
发的那个函数只是对请求的url进行了分解,具体的操作还需要你根据你的url情况自己解决