This isn't gibberish; it is simply the XML entities for <
(<
) and >
(>
). To add nested XML elements with SimpleXML, you can do the following:
$node = $account->addChild('systemInfo');
$node->addChild('test', 'asd');
You'll see that first we add a node to <account>
, then add a child to that newly created node.
If you plan on adding several children to the <systemInfo>
element, you could perhaps do the following:
$items = array(
'os' => 'Windows 7',
'ram' => '8GB',
'browser' => 'Google Chrome'
);
$node = $account->addChild('systemInfo');
foreach ($items as $key => $value) {
$node->addChild($key, $value);
}