Many virtual hosts do not support URL_rewrite.
Yesterday, I also saw a classic article written by a friend and
felt that it had too much code.
I did some research on _SERVER. In fact, it can be very simplified
and use http://www.xxx.com/xxx/test. php/article.123456.html Let’s talk about it.
This format represents _GET
http://www.xxx.com/xxx/test.php/article.123456.html
http://www.xxx.com/xxx/test.php?article=123456
=============================== ===
Which format is more handsome?
The code is as follows:
CODE: $path_info =$_SERVER["PATH_INFO"]; //Get PATH_INFO
/*Use regular expressions to match "/article.123456.html"*/
if(eregi("^/[az]{1,16}.[0-9]{1,16}.html$",$path_info)) {
echo "OK";
$get_path=substr($path_info,1,-5);//Processing styling:D Remove "/",".html"
$arr_path=explode('.',$get_path);//Processed into an array for later use
//The following is to print out the array to see if we have made any mistakes.:cool:
foreach ($arr_path as $key=>$value){
echo '$arr_path['.$key.']:'.$value."<br >";
}
}else echo "NO";
The result is as follows
CODE: $arr_path[0]:article
$arr_path[1]:123456
Just use it as $_GET, haha. PHP is so simple to generate pseudo-static