我有这样的事情:
[shortcode] text [/shortcode] [shortcode_2] text [/shortcode_2][button] [shortcode_3] text [/shortcode_3] [image] text
我如何 preg_replace (或 str_replace )以便在每个或<br />
之间插入
']['
'] ['
编辑:
为了让事情尽可能的清楚...
输入:
[shortcode] text [/shortcode] [shortcode_2] text [/shortcode_2][button] [shortcode_3] text [/shortcode_3] [image] text
输出:
[shortcode]<br />text<br />[/shortcode]<br />[shortcode_2]<br />text<br />[/shortcode_2]<br />[button]<br />[shortcode_3]<br />text<br />[/shortcode_3]<br />[image]<br />text