PHP SimpleXMLElement slash in elements -


i have string these ($_post['output_xml'):

<process>   <path>/var/somepath/</path> </process> 

the output should formatted xml written file:

header("content-type: application/json; charset=utf-8",true); header('cache-control: no-cache, must-revalidate'); $xml_data = $_post['output_xml']; $fp = fopen("xml_output.xml","w"); $xml = new simplexmlelement($xml_data); fwrite($fp,$xml->asxml()); fclose($fp); 

i error because of slash in path element. how solve this?

i have made tests here , situation php don't told me wich node have caused parsing problem when $xml_data varialble empty try check variable content.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -