I have $html which contains HTML code. Somewhere in the HTML there is a DIV with the id "content". My goal is to replace the HTML contents of this DIV. I read on this website that it's best to use a parser when working with HTML, rather than regex.I have $html which contains HTML code. Somewher