日期:2014-05-17 浏览次数:20638 次
$url = 'http://www.xxx.com/66/';66Array
@preg_replace("#/(\d{2,4})/?$#e","\$t=array('name'=>'index.php','param'=>array('t'=>1,'id'=>$1))",strtolower($url));
print_r($t);
$url='http://www.xxx.com/66/';
$s= preg_replace("#\/(\d{2,4})\/?$#","/name/index.php?t=1&id=$1",strtolower($url));
$ar=parse_url($s);
$arr['name']=substr($ar['path'],strrpos($ar['path'],'/')+1);
parse_str($ar['query'],$t);
$arr['param']=$t;
print_r($arr);