龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

php url匹配使用*通配符

时间:2014-06-15 02:28来源:网络整理 作者:网络 点击:
分享到:
url匹配使用*通配符 [代码片段(12行)]
<?php
$a = 'http://www.tetx.com/forum/viewthread.php*';
$b = str_replace('*', '____x____', $a);
$c = preg_quote($b);
$d = str_replace('/', '\/', $c);
$e = '/' . str_replace('____x____', '.+', $d) . '/is';

preg_match($e, 'http://www.tetx.com/forum/viewthread.php?tid=12345', $m);
print_r($m);
?>

精彩图集

赞助商链接