PHP / SimpleXML - Adding a Child node under Root without inheriting parent namespace

26 views Asked by At

I am trying to add a child node under the Root node however it prefixes the new child node with the Root/Parent NS. How can I simply add a new child node without the Root/Parent NS?

<?php
$file = 'file.xml';
$xml = simplexml_load_file($file);

$number = $xml->addChild('ANumber', "12345");

$xml->asXML($file);

exit; 

?>`
0

There are 0 answers