【发布时间】:2011-11-29 17:54:25
【问题描述】:
preg_replace('/\[quote\=(.*?);(.*?)\](.*?)\[\/quote\]/ms', '<blockquote>Posted by: \1 at \2.<br/>\3</blockquote>', $text);
这是我用来替换[quote=user;id]content[/quote] bbcode 的。无论如何,只有在帖子中有一个引用时,它才能正常工作。
如果我得到:
[quote=user1;1] [quote=user0;0]some content here[/quote]
this is my reply to user0 post[/quote]
它只会替换第一个引号,其他不会被<blockquote>替换。
我该如何解决这个问题?
【问题讨论】:
标签: php regex preg-replace bbcode quote