preg_replace '

' with '
'?

前端 未结 2 1537
礼貌的吻别
礼貌的吻别 2021-02-14 08:54

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:18

    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);

提交回复
热议问题