<?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: Using a Custom Class To Create JSON in&#160;PHP</title>
	<atom:link href="http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/</link>
	<description>Everyone needs a hug.</description>
	<lastBuildDate>Mon, 16 Nov 2009 21:43:07 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Steve Clay</title>
		<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/comment-page-1/#comment-25099</link>
		<dc:creator>Steve Clay</dc:creator>
		<pubDate>Mon, 21 Jul 2008 11:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/?p=326#comment-25099</guid>
		<description>&lt;p&gt;@Jeff: You don&#039;t need StdClass to get JSON objects, just an array with a non-numeric key.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Jeff: You don&#8217;t need StdClass to get JSON objects, just an array with a non-numeric key.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Willison</title>
		<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/comment-page-1/#comment-25088</link>
		<dc:creator>Simon Willison</dc:creator>
		<pubDate>Sat, 19 Jul 2008 22:17:57 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/?p=326#comment-25088</guid>
		<description>&lt;p&gt;&quot;A less memory-intensive alternative to cloning would be to create an array of a subset of the object’s member variables and then json_encode these. This may be a strong solution, but it still requires custom code, much like the JsonUtil class shown in the example.&quot; - yes, but it&#039;s absolutely fundamentally The Right Way to do this. The whole point of JSON is that it lets you transfer data structures between different languages. The idea is that you create the data structure in your language and then call an encoding function to turn it in to a JSON string. That&#039;s why JSON libraries exist! There really is no need to create an XML-style builder library to do this.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&#8220;A less memory-intensive alternative to cloning would be to create an array of a subset of the object’s member variables and then json_encode these. This may be a strong solution, but it still requires custom code, much like the JsonUtil class shown in the example.&#8221; - yes, but it&#8217;s absolutely fundamentally The Right Way to do this. The whole point of JSON is that it lets you transfer data structures between different languages. The idea is that you create the data structure in your language and then call an encoding function to turn it in to a JSON string. That&#8217;s why JSON libraries exist! There really is no need to create an XML-style builder library to do this.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: RODGER</title>
		<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/comment-page-1/#comment-25079</link>
		<dc:creator>RODGER</dc:creator>
		<pubDate>Fri, 18 Jul 2008 15:39:52 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/?p=326#comment-25079</guid>
		<description>&lt;p&gt;Everyone needs a hug. A GOOD HUG CAN MAKE ONES LIFE SEEM LIVEABLE AND WILL IMPROVE SOON!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Everyone needs a hug. A GOOD HUG CAN MAKE ONES LIFE SEEM LIVEABLE AND WILL IMPROVE SOON!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Sabat</title>
		<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/comment-page-1/#comment-25063</link>
		<dc:creator>Tim Sabat</dc:creator>
		<pubDate>Thu, 17 Jul 2008 13:54:23 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/?p=326#comment-25063</guid>
		<description>&lt;p&gt;Hey guys, thanks for keeping me on my toes!  Because of the overwhelming outcry of love for json_encode, I&#039;ve posted an update to my article explaining why I chose to write a custom Json class.  Read about it above.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey guys, thanks for keeping me on my toes!  Because of the overwhelming outcry of love for json_encode, I&#8217;ve posted an update to my article explaining why I chose to write a custom Json class.  Read about it above.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Kr0n</title>
		<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/comment-page-1/#comment-25061</link>
		<dc:creator>Kr0n</dc:creator>
		<pubDate>Thu, 17 Jul 2008 08:02:49 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/?p=326#comment-25061</guid>
		<description>&lt;p&gt;Right, another one for json_encode()&lt;/p&gt;

&lt;p&gt;Would like to know though what&#039;re Tim&#039;s reasons to use the article class, instead of json_encode ;)&lt;/p&gt;

&lt;p&gt;I use print_r to beautify json outputs, with a debug flag to turn it on. Tumblr guys do this also (http://www.tumblr.com/api)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Right, another one for json_encode()</p>

<p>Would like to know though what&#8217;re Tim&#8217;s reasons to use the article class, instead of json_encode ;)</p>

<p>I use print_r to beautify json outputs, with a debug flag to turn it on. Tumblr guys do this also (<a href="http://www.tumblr.com/api" rel="nofollow">http://www.tumblr.com/api</a>)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Maciej ?ebkowski</title>
		<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/comment-page-1/#comment-25059</link>
		<dc:creator>Maciej ?ebkowski</dc:creator>
		<pubDate>Thu, 17 Jul 2008 07:01:21 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/?p=326#comment-25059</guid>
		<description>&lt;p&gt;In addition, in pre-5.2.x there was an external module for PHP, that added json_encode/decode functions. So even for not up-to-date installations there`s a really simple solution.&lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>In addition, in pre-5.2.x there was an external module for PHP, that added json_encode/decode functions. So even for not up-to-date installations there`s a really simple solution.</p>

<p>Cheers.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/comment-page-1/#comment-25055</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Thu, 17 Jul 2008 01:39:43 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/?p=326#comment-25055</guid>
		<description>&lt;p&gt;I agree, json_encode() is the way to go. Since you probably already have the data in an array/object, you can do it in one line. I&#039;ve used in on a number of projects, and works great. Thanks for the tip about the TextMate JSON bundle, that will be helpful for debugging.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I agree, json_encode() is the way to go. Since you probably already have the data in an array/object, you can do it in one line. I&#8217;ve used in on a number of projects, and works great. Thanks for the tip about the TextMate JSON bundle, that will be helpful for debugging.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/comment-page-1/#comment-25052</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 17 Jul 2008 00:07:11 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/?p=326#comment-25052</guid>
		<description>&lt;p&gt;I&#039;m with Jeff, why not use a standard object/array and seralize it. Like in this class: http://cesars.users.phpclasses.org/browse/file/20928.html&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;m with Jeff, why not use a standard object/array and seralize it. Like in this class: <a href="http://cesars.users.phpclasses.org/browse/file/20928.html" rel="nofollow">http://cesars.users.phpclasses.org/browse/file/20928.html</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Parman</title>
		<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/comment-page-1/#comment-25046</link>
		<dc:creator>Ryan Parman</dc:creator>
		<pubDate>Wed, 16 Jul 2008 23:18:55 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/?p=326#comment-25046</guid>
		<description>&lt;p&gt;Yeah, json_encode() is built into PHP 5.2.x and is much, much better.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yeah, json_encode() is built into PHP 5.2.x and is much, much better.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://particletree.com/notebook/using-a-custom-class-to-create-json-in-php/comment-page-1/#comment-25045</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Wed, 16 Jul 2008 22:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/?p=326#comment-25045</guid>
		<description>&lt;p&gt;Can you go back to the part of the article where you explain why you are using this class instead of creating beautiful Object/Array sets and simply using &lt;a href=&quot;http://se.php.net/manual/en/function.json-encode.php&quot; rel=&quot;nofollow&quot;&gt;json_encode()&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;I mean:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
$data = new StdClass(); // initiating objects in php is kinda ugly...
$data-&gt;submission = $Subfields;
$json = json_encode($data);
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Done?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Can you go back to the part of the article where you explain why you are using this class instead of creating beautiful Object/Array sets and simply using <a href="http://se.php.net/manual/en/function.json-encode.php" rel="nofollow">json_encode()</a>?</p>

<p>I mean:</p>

<p><code>
$data = new StdClass(); // initiating objects in php is kinda ugly...
$data-&gt;submission = $Subfields;
$json = json_encode($data);
</code></p>

<p>Done?</p>]]></content:encoded>
	</item>
</channel>
</rss>
