Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Array to Xml
header("Content-Type: text/xml");
$array = array (
'' => 'Server'
$xml = new SimpleXMLElement('<root/>');
array_walk_recursive($array, array ($xml, 'addChild'));
print $xml->asXML();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.