I'm having a problem with SimpleXML. When I'm using the children() method to get the contents of an XML element, with elements that contain HTML, it will parse the HTML contents as XML. How would I make it so that it won't parse HTML?
3 Answers
Comments
The example you posted is valid XML, but the <div> and <img>-tags are part of the XML document.
Basically, you have to use CDATA (see natriums answer), or escape the HTML entities in the XML.