Output array of XML to plain XML
- by danit
I have a script which collects 4 URL's (XML) using CURL and returns an array with 4 items each ocntaining the results of the URL's.
Here is the array:
array(3) {
[0]=>
string(41772) "<?xml version="1.0" encoding="UTF-8"?>
<statuses type="array">
<status>
<created_at>Tue Mar 30 20:58:53 +0000 2010</created_at>
<id>11328253513</id>
<text>...</text>
<source...</source>
<truncated>false</truncated>
<in_reply_to_status_id></in_reply_to_status_id>
<in_reply_to_user_id></in_reply_to_user_id>
<favorited>true</favorited>
<in_reply_to_screen_name></in_reply_to_screen_name>
<user>
<id>1...</id>
<name>....</name>
</status>
</statuses>
"
[1]=>
string(20630) "<?xml version="1.0" encoding="UTF-8"?>
<statuses type="array">
<status>
<created_at>Sun Feb 28 14:12:30 +0000 2010</created_at>
<id>...</id>
<text>...</text>
<source><a
etc...
How can I easily output the XML from the array? I also need to combine the 3 XML structures into one where begins and ends in between each array.