当前位置: 代码迷 >> PHP >> 哪位高手有将页面所有连接全部生产伪静态function方法
  详细解决方案

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

热度:41   发布时间:2016-04-28 18:18:48.0
谁有将页面所有连接全部生产伪静态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');

function foo($url) {
  $t = parse_url($url);
  parse_str($t['query'], $r);
  return "$r[c]-$r[m]-$r[id].html";
}
index-lists-1.html
  相关解决方案