假设我有绳子
test [caption id="attachment_13399" align="alignleft" width="240"]<img class="img" src="test.jpg" alt="Test Image" width="240" height="270" /> Test remove capture[/caption] end test我只需要在preg_replace之后显示:test end test
但我得到了test Test remove capture end test。
我的判断是:$text = preg_replace('/\[.*?\]/', '', $a_record['content'])
你能帮帮我吗?提前为我的英语道歉
发布于 2016-04-12 13:10:19
改为:
/\\[caption.*?\\].*\\[.caption\\]/这将删除[caption]和[/caption]之间的所有内容
https://stackoverflow.com/questions/36574001
复制相似问题