preg_replace '

' with '
'?

前端 未结 2 1929
野趣味
野趣味 2021-02-14 08:31

I have my code removing the

starting tags, but now I want to replace the ending

tags with line breaks. How can I do this?

2条回答
  •  醉话见心
    2021-02-14 09:15

    use str_replace instead of preg_replace, so:

    $content = '

    This is a new content for missing slash

    '; $newcontent = preg_replace("/]*?>/", "", $content); $newcontent = str_replace("

    ", "
    ", $newcontent);

提交回复
热议问题