<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/1.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: XML to Array</title>
	<link>http://whoooop.co.uk/2005/03/20/xml-to-array/</link>
	<description>Random mutterings from the insane</description>
	<pubDate>Wed, 09 Jul 2008 11:42:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5</generator>

	<item>
		<title>by: Fatih</title>
		<link>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-9</link>
		<pubDate>Wed, 23 Mar 2005 17:29:04 -0500</pubDate>
		<guid>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-9</guid>
					<description>Thanks for such a useful code... That is waht I needed...</description>
		<content:encoded><![CDATA[	<p>Thanks for such a useful code&#8230; That is waht I needed&#8230;
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Matt</title>
		<link>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-24</link>
		<pubDate>Mon, 28 Mar 2005 22:49:35 -0500</pubDate>
		<guid>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-24</guid>
					<description>Fantastic.  Fast and exactly what I was looking for.  Thanks!</description>
		<content:encoded><![CDATA[	<p>Fantastic.  Fast and exactly what I was looking for.  Thanks!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Michael</title>
		<link>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-31</link>
		<pubDate>Thu, 31 Mar 2005 03:15:13 -0500</pubDate>
		<guid>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-31</guid>
					<description>I think this is great, however it seems to be missing one attibute function. When you load an xml into it where the father node has attributes AND childNodes it gets the value of the childNodes into array, however if it's just nodes with attributes it puts the attributes into the array. It would be great if it somehow did both. An example is this&lt;a href=&quot;http://www.flickr.com/services/rest/?method=flickr.photosets.getList&amp;amp;api_key=5183ae27a367b424cf2a3eae6a4e3016&amp;amp;user_id=55919679@N00&quot; rel=&quot;nofollow&quot;&gt; flickr xml &lt;/a&gt;</description>
		<content:encoded><![CDATA[	<p>I think this is great, however it seems to be missing one attibute function. When you load an xml into it where the father node has attributes AND childNodes it gets the value of the childNodes into array, however if it&#8217;s just nodes with attributes it puts the attributes into the array. It would be great if it somehow did both. An example is this<a href="http://www.flickr.com/services/rest/?method=flickr.photosets.getList&amp;api_key=5183ae27a367b424cf2a3eae6a4e3016&amp;user_id=55919679@N00" rel="nofollow"> flickr xml </a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: cristi</title>
		<link>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-32</link>
		<pubDate>Thu, 31 Mar 2005 18:07:20 -0500</pubDate>
		<guid>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-32</guid>
					<description>The script don't work in PHP5. :(</description>
		<content:encoded><![CDATA[	<p>The script don&#8217;t work in PHP5. <img src='http://whoooop.co.uk/wp-images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: CaShY</title>
		<link>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-33</link>
		<pubDate>Thu, 31 Mar 2005 18:16:36 -0500</pubDate>
		<guid>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-33</guid>
					<description>theres an easy fix for it just can't for the life of me think what it was.

Never mind hopefully someone will post how to</description>
		<content:encoded><![CDATA[	<p>theres an easy fix for it just can&#8217;t for the life of me think what it was.</p>
	<p>Never mind hopefully someone will post how to
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: CaShY</title>
		<link>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-34</link>
		<pubDate>Thu, 31 Mar 2005 18:20:23 -0500</pubDate>
		<guid>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-34</guid>
					<description>basically

SNIP]
function GetXMLTree ($xmldata)
{
   &lt;strong&gt;$attributes =array();&lt;/strong&gt;

   // we want to know if an error occurs
   ini_set ('track_errors', '1');
[SNIP]

makes it work in php5</description>
		<content:encoded><![CDATA[	<p>basically</p>
	<p>SNIP]<br />
function GetXMLTree ($xmldata)<br />
{<br />
   <strong>$attributes =array();</strong></p>
	<p>   // we want to know if an error occurs<br />
   ini_set (&#8217;track_errors&#8217;, &#8216;1&#8242;);<br />
[SNIP]</p>
	<p>makes it work in php5
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: cristi</title>
		<link>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-35</link>
		<pubDate>Sat, 02 Apr 2005 08:47:30 -0500</pubDate>
		<guid>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-35</guid>
					<description>Thanks, CaShY. You help me very much. </description>
		<content:encoded><![CDATA[	<p>Thanks, CaShY. You help me very much.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ibrahim</title>
		<link>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-68</link>
		<pubDate>Tue, 19 Apr 2005 10:40:00 -0400</pubDate>
		<guid>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-68</guid>
					<description>any idea of how to fix the problem that Michael pointed out ?

Thanx</description>
		<content:encoded><![CDATA[	<p>any idea of how to fix the problem that Michael pointed out ?</p>
	<p>Thanx
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ibrahim</title>
		<link>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-69</link>
		<pubDate>Tue, 19 Apr 2005 10:41:45 -0400</pubDate>
		<guid>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-69</guid>
					<description>with this simple xml file , i get all attributes but not the name of the city

exemple : 


  BC 
  516521 
  -1212891 
  -800 
  1 
  </description>
		<content:encoded><![CDATA[	<p>with this simple xml file , i get all attributes but not the name of the city</p>
	<p>exemple : </p>
	<p>  BC<br />
  516521<br />
  -1212891<br />
  -800<br />
  1
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jose</title>
		<link>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-80</link>
		<pubDate>Fri, 22 Apr 2005 10:02:47 -0400</pubDate>
		<guid>http://whoooop.co.uk/2005/03/20/xml-to-array/#comment-80</guid>
					<description>Very useful code but I had problems with empty xml files, for example:

&amp;lt;NAME&amp;gt; &amp;lt;/NAME&amp;gt;

I fix the problem changing the call to the funtion GetChildren in the main function....

----- original ------
$result [$vals [$i]['tag']] = array_merge ($attributes, GetChildren ($vals, $i, 'open'));
----- fixed --------
$result [$vals [$i]['tag']] = array_merge ($attributes, GetChildren ($vals, $i, $vals[$i]['type']));

Sorry for my poor english and thanks for the code.</description>
		<content:encoded><![CDATA[	<p>Very useful code but I had problems with empty xml files, for example:</p>
	<p>&lt;NAME&gt; &lt;/NAME&gt;</p>
	<p>I fix the problem changing the call to the funtion GetChildren in the main function&#8230;.</p>
	<p>&#8212;&#8211; original &#8212;&#8212;<br />
$result [$vals [$i][&#8217;tag&#8217;]] = array_merge ($attributes, GetChildren ($vals, $i, &#8216;open&#8217;));<br />
&#8212;&#8211; fixed &#8212;&#8212;&#8211;<br />
$result [$vals [$i][&#8217;tag&#8217;]] = array_merge ($attributes, GetChildren ($vals, $i, $vals[$i][&#8217;type&#8217;]));</p>
	<p>Sorry for my poor english and thanks for the code.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
