- print_r: documentation ( source)
- array_merge: documentation ( source)
<?php
$a = array('xml' => array(
'attributes' => array(
'version' => '1.0',
'encoding' => 'utf-8',
),
));
$t = array('test' => 'my_test_123');
$t = array();
$a['xml']['attributes'] = array_merge($a['xml']['attributes'], $t);
print_r($a);