Strip BBCode via RegEx

前端 未结 2 1311
走了就别回头了
走了就别回头了 2020-12-22 09:22

I am trying to setup a regex that will detect [quote]???[/quote] and will remove it.

This is what I have but it is not working:

$post[\'body\'] = pre         


        
2条回答
  •  囚心锁ツ
    2020-12-22 10:15

    Just figured out my own issue.

    $post['body'] = preg_replace("/\[quote\](.+?)\[\/quote\]/is", '', $post['body']); $body = trim(rtrim($post[0]['body']));

提交回复
热议问题