Home > php教程 > php手册 > 不用mod_rewrite直接用php实现伪静态化页面代码

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

WBOY
Release: 2016-06-13 12:25:50
Original
1138 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一样。
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template