Home > Backend Development > PHP Tutorial > rewrite directly uses php to implement pseudo-static page code without mod_rewrite

rewrite directly uses php to implement pseudo-static page code without mod_rewrite

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 08:39:00
Original
1027 people have browsed it

Use the following code when initializing your program:

Copy the code The code is as follows:


$Php2Html_FileUrl = $_SERVER["REQUEST_URI"];
$Php2Html_UrlString = str_replace("/", "", strrchr($Php2Html_FileUrl, "/"));
$Php2Html_UrlQueryStrList = explode("@", $Php2Html_UrlString);
foreach($Php2Html_UrlQueryStrList as $Php2Html_UrlQueryStr)
{
$Php2Html_T mpArray = explode("|", $ Php2Html_UrlQueryStr);
$_GET[$Php2Html_TmpArray[0]] = $Php2Html_TmpArray[1];
}
echo Fake static: $_GET variable
;
print_r($_GET);
?>


Then calling the $_GET variable in php is like normal.
Connection usage:
****.php/param1|1234@param2|4321
Same as ****.php?param1=1234¶m2=4321.

The above introduces rewrite, which uses PHP directly to implement pseudo-static page code without mod_rewrite, including the content of rewrite. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
url-rewrite - nginx rewrite problem
From 1970-01-01 08:00:00
0
0
0
php - apache rewrite unstable
From 1970-01-01 08:00:00
0
0
0
Ask a question about apache rewrite
From 1970-01-01 08:00:00
0
0
0
rewrite - How can nginx rewrite certain routes?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template