Home > Backend Development > PHP Tutorial > 不用mod_rewrite直接用php实现伪静态化页面代码_php技巧

不用mod_rewrite直接用php实现伪静态化页面代码_php技巧

WBOY
Release: 2016-05-17 09:34:38
Original
1075 people have browsed it

在你的程序初始化时使用如下代码: 

复制代码 代码如下:

$Php2Html_FileUrl = $_SERVER["REQUEST_URI"];
$Php2Html_UrlString = str_replace("/", "", strrchr($Php2Html_FileUrl, "/"));
$Php2Html_UrlQueryStrList = explode("@", $Php2Html_UrlString);
foreach($Php2Html_UrlQueryStrList as $Php2Html_UrlQueryStr)
{
$Php2Html_TmpArray = explode("|", $Php2Html_UrlQueryStr);
$_GET[$Php2Html_TmpArray[0]] = $Php2Html_TmpArray[1];
}
echo 假静态:$_GET变量
;
print_r($_GET);
?>


然后php中调用$_GET变量就像平常一样了。
连接使用方式:
****.php/param1|1234@param2|4321
和****.php?param1=1234¶m2=4321一样。
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template