Home  >  Article  >  php教程  >  TPURL路由支持中文参数

TPURL路由支持中文参数

WBOY
WBOYOriginal
2016-06-07 11:42:271491browse

修改TP的URL路由转换代码,让URL路由支持中文参数。
路由规则'/^Search\/([a-z]+)_([%A-Za-z0-9]+)_(\d+)_(\d+)_(\d+)$/' => 'Goods/search?s=:1&k=:2&o=:3&r=:4&p=:5',ThinkPHP\Lib\Behavior\CheckRouteBehavior.class.php line38$depr = URLEncode(C('URL_PATHINFO_DEPR'));<br> // 分隔符替换 确保路由定义使用统一的分隔符<br> $regx = str_replace($depr,'/',URLEncode($regx));

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
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