Strip Tags and everything in between

前端 未结 5 1324
南方客
南方客 2020-11-29 08:30

How can i strip

including this content

I know you can use strip tags to remove the tags, but i want everything in between gone as w

5条回答
  •  青春惊慌失措
    2020-11-29 09:06

    Try this:

    preg_replace('/]*>([\s\S]*?)<\/h1[^>]*>/', '', '

    including this content

    ');

    Example:

    echo preg_replace('/]*>([\s\S]*?)<\/h1[^>]*>/', '', 'Hello

    including this content

    There !!');

    Output:

    Hello There
    

提交回复
热议问题