Home > Backend Development > PHP Tutorial > 哪位高手有将页面所有连接全部生产伪静态function方法

哪位高手有将页面所有连接全部生产伪静态function方法

WBOY
Release: 2016-06-13 12:09:22
Original
818 people have browsed it

谁有将页面所有连接全部生产伪静态function方法?
如果将页面中index.php?c=index&m=lists&id=1这样连接方式全部通过PHP正则替换成 index-lists-1.html的function方法?请高手提供个方法使用下
------解决思路----------------------

echo foo('index.php?c=index&m=lists&id=1');<br /><br />function foo($url) {<br />  $t = parse_url($url);<br />  parse_str($t['query'], $r);<br />  return "$r[c]-$r[m]-$r[id].html";<br />}<br />
Copy after login
index-lists-1.html

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