当前位置:首页> PHP教程> php进阶
关键字
文章内容
发个伪静态
 
 
修改时间:[2011/04/24 15:13]    阅读次数:[1617]    发表者:[起缘]
 
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));


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));


(非常全面的一个php技术网站, 有相当丰富的文章和源代码.)