时间:2021-07-01 10:21:17 帮助过:20人阅读
一步不行,需要自行分析形成数组。
$url = 'http://www.xxx.com/66/';@preg_replace("#/(\d{2,4})/?$#e","\$t=array('name'=>'index.php','param'=>array('t'=>1,'id'=>$1))",strtolower($url));print_r($t);66Array
$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);