I receive a $_POST array from a system after a certain action has been performed on a database. I've tried accesing the array and saving it as an simple_xml object. So far I have not succeeded. The array which is being sent looks like this.
Array
(
[xml] => <?xml version=\"1.0\"?>
<callback><profile><id>313009</id><fields><email>tomkriek@gmail.com</email><nieuwsbrief>8</nieuwsbrief></fields><interests></interests></profile><action>update</action><parameters><nieuwsbrief>8</nieuwsbrief></parameters></callback>
)
I've tried storing this as a simple_xml object like this.
if($xml_test = simplexml_load_string($_POST['xml']))
{
$xml_test->saveXML('test.xml');
}
I can save a different kind of .xml file so I'm sure the permissions are set right. As for the rest I'm not that familiar with formatting and parsing .xml files so I hope anyone could help a hand with this.
My desired outcome is that I can access the newly made simple_xml object and access the values and fields.