Remove text outside xml tags - PHP

Shawn23

New Member
Some times I receive text outside the xml tags in XML like this:\[code\]Bad command error. XYZ. Some more text<?xml version="1.0" encoding="utf-8"?><xml></xml>\[/code\]This returns error in php. Because I am using this function to read the xml:\[code\]simplexml_load_string($xml);\[/code\]Is there a way that I can remove the text outside xml tags so that i do not get error in xml ?Thanks in advance!
 
Back
Top