Php 解析URL时遇到问题 $editThisUrl=“”; echo$editThisUrl;
因此,我试图从上面的$editThisUrl解析“index.php/admin/”——我无法正确获取正则表达式。我在CMS中使用非常严格的路径,有什么想法吗?感谢您的帮助为什么不直接使用Php 解析URL时遇到问题 $editThisUrl=“”; echo$editThisUrl;,php,regex,Php,Regex,因此,我试图从上面的$editThisUrl解析“index.php/admin/”——我无法正确获取正则表达式。我在CMS中使用非常严格的路径,有什么想法吗?感谢您的帮助为什么不直接使用 我不明白这个问题。你能举个例子吗。$editThisUrl看起来像这样:http://test.example.net/index.php/admin/downloads/HPIM0276%20Alll%20Day%20Long.JPG我需要它看起来像这样:http://test.example.net/do
我不明白这个问题。你能举个例子吗。$editThisUrl看起来像这样:
http://test.example.net/index.php/admin/downloads/HPIM0276%20Alll%20Day%20Long.JPG
我需要它看起来像这样:http://test.example.net/downloads/HPIM0276%20Alll%20Day%20Long.JPG
尝试使用str_替换,在上述情况下,echo$begone_索引
给我的结果与echo$editThisURL相同代码>
$editThisUrl = "<li><a href=\"".$path.$file."\">$file</a></li>";
echo $editThisUrl;
$begone_index = str_replace("index.php/admin/","",$editThisURL);