2012-07-02 69 views
-2

我联系:正则表达式,需要支持

/admin/index.php 
/admin/index.php?do=delete_user 
/forum/index.php?search=aaa&type=a 
/index.php 
/index.php?p=home 

等等...

如何的preg_replace()的链接,只有index.php文件没有GET的会改变(如果有GET的dont'replace )。

谢谢,它的工作,但为什么不工作这(?!&),(?!\ &)?我想保持不变后,如果asd.aa/index.php的新闻= 1存在&(asd.aa/index.php的新闻= 1 &不要=改变?)

+0

之后没有?我想你需要澄清这一点,所以我们可以准确理解你想要的。 – JRSofty

+0

您的问题不清楚,请添加示例输入和输出。 – xdazz

+0

请将您的标题改为更具描述性 –

回答

0

使用负前瞻:'/index\.php(?!\?)/'只会匹配如果在index.php