How do I remove

tag and its content from HTML using php

后端 未结 7 1231
既然无缘
既然无缘 2021-02-06 06:22

Below is the text I need to remove

tags from

Addiction, stress and subjective wellbeing

The need and signi

7条回答
  •  你的背包
    2021-02-06 06:25

    Try:

    If you want to remove

    tag only

    $html = "
    

    Addiction, stress and subjective wellbeing

    The need and significance of traditional shop lot pavements town

    The role of wage and benefit in engaging employee commitment

    "; echo strip_tags($html);

    If you want to remove

    tags and its content

    $html = preg_replace('#\

    [{\w},\s\d"]+\

    #', "", $html);

提交回复
热议问题