How to use pure PHP code to achieve pseudo-static page, php
The example in this article describes the method of using pure PHP code to achieve pseudo-static page. Share it with everyone for your reference. The details are as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | if (1==URLROLE){
$nav = $_SERVER [ "REQUEST_URI" ];
$script_name = $_SERVER [ "SCRIPT_NAME" ];
$nav1 = ereg_replace ( ".html" , "" , substr ( ereg_replace ( "$script_name" , "" ,urldecode( $nav )),1));
$vars = @ explode ( "/" , $nav1 );
$_url = array_chunk ( $vars ,2);
$_GET [ 'm' ] = $vars [0]? $vars [0]: 'index' ;
$_GET [ 'a' ] = $vars [1]? $vars [1]: 'index' ;
unset( $_url [0]);
if ( $_url ){
foreach ( $_url as $key => $val ){
@ $_GET [ $val [0]] = $val [1];
}
}
}
|
Copy after login
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/1038588.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1038588.htmlTechArticleHow to use pure PHP code to achieve pseudo-static page, php This article describes the use of pure PHP code to achieve pseudo-static page method. Share it with everyone for your reference. The details are as follows: if(1...