尝试将
放到的前面>。
编辑:我刚刚测试了您的正则表达式,它工作正常。这是我使用的:
<? $content = "this is something with an <img src="test.png"/> in it."; $content = preg_replace("/<img[^>]+>/i", "(image) ", $content); echo $content;?>结果是:
这是带有(图像)的东西。

尝试将
放到的前面>。
编辑:我刚刚测试了您的正则表达式,它工作正常。这是我使用的:
<? $content = "this is something with an <img src="test.png"/> in it."; $content = preg_replace("/<img[^>]+>/i", "(image) ", $content); echo $content;?>结果是:
这是带有(图像)的东西。