I have this:
$text = 'text text text s html tagove
<div id="content">ss adsda sdsa </div>
oshte text s html tagove';
$content = preg_replace('/(<div\sid=\"content\">)[^<]+(<\/div>)/i', '', $text);
var_dump($content);
But if the <div id="content"></div> contains other tags, such as <b>,<i> etc, it does not work.
For example:
$text = 'text text text s html tagove
<div id="content"><b> stfu </b> ss adsda sdsa </div>
oshte text s html tagove';
You can use lazy quantifiers instead.
output:
UPDATE per comments: