Output array of XML to plain XML

Posted by danit on Stack Overflow See other posts from Stack Overflow or by danit
Published on 2010-03-31T16:29:28Z Indexed on 2010/03/31 16:33 UTC
Read the original article Hit count: 273

Filed under:

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>&lt;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.

© Stack Overflow or respective owner

Related posts about php