The XML is most probably invalid.
The problem could be the “&”
$text=preg_replace('/&(?!#?[a-z0-9]+;)/g', '&', $text);
will get rid of the “&” and replace it with it’s HTML code version…give it a try.
More Related Contents:
- How to convert array to SimpleXML
- Remove a child with a specific attribute, in SimpleXML for PHP
- Simple XML – Dealing With Colons In Nodes
- Forcing a SimpleXML Object to a string, regardless of context
- Parse XML with Namespace using SimpleXML [duplicate]
- How to get the value of an attribute from XML file in PHP?
- PHP library for parsing XML with a colons in tag names? [duplicate]
- PHP namespace simplexml problems
- Implementing condition in XPath [duplicate]
- SimpleXML and print_r() – why is this empty?
- How to write CDATA using SimpleXmlElement?
- How can I set text value of SimpleXmlElement without using its parent?
- Using SimpleXML to read RSS feed
- PHP SimpleXML: insert node at certain position
- Accessing @attribute from SimpleXML
- Best way to process large XML in PHP [duplicate]
- Updating XML node with PHP
- SimpleXML: Working with XML containing namespaces
- Using SimpleXML to load remote URL
- PHP – Processing Invalid XML
- Loop through an XML object with SimpleXML
- PHP convert XML to JSON group when there is one child
- Using SimpleXML to create an XML object from scratch
- PHP, SimpleXML, decoding entities in CDATA
- PHP SimpleXML + Get Attribute
- converting SOAP XML response to a PHP object or array
- SimpleXML SOAP response Namespace issues
- How to get attribute of node with namespace using SimpleXML? [closed]
- Format output of $SimpleXML->asXML(); [duplicate]
- How to import XML string in a php DOMDocument