PHP实现网址伪静态的方法:1、使用函数【$_SERVER['PATH_INFO']】操作实现;2、配置【.htaccess】来,网站建设时使用【mod_rewrite】模块来实现伪静态。

PHP实现网址伪静态的方法:
1.根据$_SERVER['PATH_INFO']来操作实现。
举个列子比如你的网站的地址是 http://127.0.0.1/show_new.php/look-id-1.shtml
echo $_SERVER['PATH_INFO']
出来的结果就会是
/look-id-1.shtml
看到这个我想大家可能已经明白了。完整的demo







