2016-11-24, 01:01:02
does your input data change also
"$atts= $data->children();" instead of attributes , is that correct for the input data ?
It looks ok at a glance, hmm
also you are modifying your foreach value variable $data
$data = $xml->addChild('data');
use another varname like $node
"$atts= $data->children();" instead of attributes , is that correct for the input data ?
It looks ok at a glance, hmm
also you are modifying your foreach value variable $data
$data = $xml->addChild('data');
use another varname like $node
PHP Code:
foreach ($testfile->data as $data)
{
$atts= $data->children();
$node= $xml->addChild('data');
$node->addChild('name', $atts['name']);
}