<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Turning an Array or Object into XML using PHP</title>
	<atom:link href="http://www.sean-barton.co.uk/2009/03/turning-an-array-or-object-into-xml-using-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sean-barton.co.uk/2009/03/turning-an-array-or-object-into-xml-using-php/</link>
	<description>by Sean Barton, a freelance PHP website developer in Crewe, Cheshire</description>
	<lastBuildDate>Tue, 07 Feb 2012 21:17:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: yanegorz</title>
		<link>http://www.sean-barton.co.uk/2009/03/turning-an-array-or-object-into-xml-using-php/comment-page-1/#comment-6169</link>
		<dc:creator>yanegorz</dc:creator>
		<pubDate>Tue, 11 Oct 2011 12:43:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=241#comment-6169</guid>
		<description>great
what I was looking :)
---
little fix to better formating output
---
function generate_xml_from_array($array, $node_name, $tab = &#039;  &#039;) {
    $xml = &#039;&#039;;

    if (is_array($array) &#124;&#124; is_object($array)) {
        foreach ($array as $key=&gt;$value) {
            if (is_numeric($key)) {
                $key = $node_name;
            }

            $xml .= $tab . &#039;&#039; . &quot;\n&quot;;
            $xml .= generate_xml_from_array($value, $node_name, $tab . &#039;  &#039;);
            $xml .= $tab . &#039;&#039; . &quot;\n&quot;;
        }
    } else {
        $xml = $tab . htmlspecialchars($array, ENT_QUOTES) . &quot;\n&quot;;
    }

    return $xml;
}</description>
		<content:encoded><![CDATA[<p>great<br />
what I was looking <img src='http://www.sean-barton.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
&#8212;<br />
little fix to better formating output<br />
&#8212;<br />
function generate_xml_from_array($array, $node_name, $tab = &#8216;  &#8216;) {<br />
    $xml = &#8221;;</p>
<p>    if (is_array($array) || is_object($array)) {<br />
        foreach ($array as $key=&gt;$value) {<br />
            if (is_numeric($key)) {<br />
                $key = $node_name;<br />
            }</p>
<p>            $xml .= $tab . &#8221; . &#8220;\n&#8221;;<br />
            $xml .= generate_xml_from_array($value, $node_name, $tab . &#8216;  &#8216;);<br />
            $xml .= $tab . &#8221; . &#8220;\n&#8221;;<br />
        }<br />
    } else {<br />
        $xml = $tab . htmlspecialchars($array, ENT_QUOTES) . &#8220;\n&#8221;;<br />
    }</p>
<p>    return $xml;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Extending Ian Selby&#8217;s RESTful API in PHP &#124; Neil Young CV</title>
		<link>http://www.sean-barton.co.uk/2009/03/turning-an-array-or-object-into-xml-using-php/comment-page-1/#comment-5951</link>
		<dc:creator>Extending Ian Selby&#8217;s RESTful API in PHP &#124; Neil Young CV</dc:creator>
		<pubDate>Fri, 10 Jun 2011 15:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=241#comment-5951</guid>
		<description>[...] XmlSerialiser class is based on Sean Barton&#8217;s excellent blog post that explains how to turn array objects into valid xml. These functions were adapted into a class which I decided to use as an alternative to the PEAR [...]</description>
		<content:encoded><![CDATA[<p>[...] XmlSerialiser class is based on Sean Barton&#8217;s excellent blog post that explains how to turn array objects into valid xml. These functions were adapted into a class which I decided to use as an alternative to the PEAR [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 7/17 queries in 0.040 seconds using disk
Object Caching 315/316 objects using disk

Served from: www.sean-barton.co.uk @ 2012-02-10 10:53:49 -->
