I am trying to remove this div
<div id="myid" class="myclass">other_tags_here</div>
I am using
preg_replace ("/<div id=\"myid\" class=\"myclass\">/", "", $buffer)
but this removes only the first opening tag while I want to remove both opening and closing tags as well as all tags in between.
Thank you
Don’t do this. Please use the very nice PHP DOM facilities.
Although a regex can be written to match your particular case, this will be fragile.