这样的格式来表示_GET
http://www.xxx.com/xxx/test.php/article.123456.html
http://www.xxx.com/xxx/test.php?article=123456
==================================
哪种格式更帅呢.
代码如下:
CODE:
$path_info =$_SERVER["PATH_INFO"]; //取得PATH_INFO
/*用正则来匹配 "/article.123456.html"*/
if(eregi("^/[a-z]{1,16}.[0-9]{1,16}.html$",$path_info)) {
echo "OK";
$get_path=substr($path_info,1,-5);//处理造型:D 去掉"/",".html"
$arr_path=explode('.',$get_path);//处理成数组备用
//以下是打印出数组看看我们有没有搞错的哦.:cool:
foreach ($arr_path as $key=>$value){
echo '$arr_path['.$key.']:'.$value."<br >";
}
}else echo "NO";
结果如下
CODE: $arr_path[0]:article
$arr_path[1]:123456
直接当$_GET使用吧,呵呵.PHP生成伪静态就是这么简单