I have the following array. I'm not even sure if that array is properly formatted. I am not even sure if my array is right.
I want to convert the following array to a serialized XML using PHP. I am using attr tag for the attributes.
Here is the array:
$data = Array(
'name' => 'account',
'attr' => Array(
'id' => 123456
),
'children' => Array(
Array(
'name' => 'name',
'attr' => Array(),
'children' => Array(
'BBC'
),
),
Array(
'name' => 'monitors',
'attr' => Array(),
'children' => Array(
Array(
'name' => 'monitor',
'attr' => Array(
'id' => 5235632
),
'children' => Array(
Array(
'name' => 'url',
'attr' => Array(),
'children' => Array(
'http://www.bbc.co.uk/'
)
)
)
),
Array(
'name' => 'monitor',
'attr' => Array(
'id' => 5235633
),
'children' => Array(
Array(
'name' => 'url',
'attr' => Array(),
'children' => Array(
'http://www.bbc.co.uk/news'
)
)
)
)
)
)
)
);