<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Beyond Coding &#187; Testing</title>
	<atom:link href="http://www.beyondcoding.com/category/php/testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.beyondcoding.com</link>
	<description>Follow us on Twitter: @fredwu and @scotti3g</description>
	<lastBuildDate>Sun, 08 Aug 2010 23:27:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>json_encode() for PHP4 and early PHP5</title>
		<link>http://www.beyondcoding.com/2008/11/11/json_encode-for-php4-and-early-php5/</link>
		<comments>http://www.beyondcoding.com/2008/11/11/json_encode-for-php4-and-early-php5/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 09:23:41 +0000</pubDate>
		<dc:creator>scotti3g</dc:creator>
				<category><![CDATA[Javascript / AJAX]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[php4]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.beyondcoding.com/?p=109</guid>
		<description><![CDATA[Had a beauty today. There I was ready to deploy some nicely polished code to the server. After some thorough local testing it looked like it&#8217;d be a smooth process. So the code went up, but all my funky AJAX stuff stopped working on the server. How could that be? It was perfect locally&#8230; :) [...]]]></description>
			<content:encoded><![CDATA[<p>Had a beauty today. There I was ready to deploy some nicely polished code to the server. After some thorough local testing it looked like it&#8217;d be a smooth process. So the code went up, but all my funky AJAX stuff stopped working on the server. How could that be? It was perfect locally&#8230; :)</p>
<p>It took a little while but in the end I realised what was going on &#8211; <em>json_encode wasn&#8217;t working</em>. The server was running PHP 5.1.6 and <em>json_encode only became &#8220;standard&#8221; with PHP 5.2.0 onward</em>.</p>
<p>I needed a solution fast. No time to recompile a newer version of PHP, add libraries or anything fancy like that. I just needed the function json_encode to work right now. Thankfully, the solution was as easy as adding replacement a function a user kindly submitted from the PHP site itself:</p>
<p><a href="http://au.php.net/manual/en/function.json-encode.php#82904">http://au.php.net/manual/en/function.json-encode.php#82904</a></p>
<p>I blindly assumed PHP 5 was PHP 5. I wasn&#8217;t using any extremely fancy commands or anything, but I still came unstuck. So the moral of today is <em>check your server specification right down to every last decimal point!</em> ;)</p>

	Tags: <a href="http://www.beyondcoding.com/tag/ajax/" title="AJAX" rel="tag">AJAX</a>, <a href="http://www.beyondcoding.com/tag/deployment/" title="deployment" rel="tag">deployment</a>, <a href="http://www.beyondcoding.com/tag/json/" title="json" rel="tag">json</a>, <a href="http://www.beyondcoding.com/tag/php4/" title="php4" rel="tag">php4</a>, <a href="http://www.beyondcoding.com/tag/php5/" title="php5" rel="tag">php5</a>, <a href="http://www.beyondcoding.com/tag/testing/" title="Testing" rel="tag">Testing</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.beyondcoding.com/2009/01/15/release-jquery-plugin-endless-scroll/" title="Release: [jQuery Plugin] Endless Scroll (January 15, 2009)">Release: [jQuery Plugin] Endless Scroll</a> (36)</li>
	<li><a href="http://www.beyondcoding.com/2007/12/15/oh-where-did-my-theme-go/" title="Oh, where did my theme go? (December 15, 2007)">Oh, where did my theme go?</a> (1)</li>
	<li><a href="http://www.beyondcoding.com/2008/11/20/jquery-problems-in-ie-it-could-be-swfobjects/" title="jQuery problems in IE? It could be SWFObjects. (November 20, 2008)">jQuery problems in IE? It could be SWFObjects.</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.beyondcoding.com/2008/11/11/json_encode-for-php4-and-early-php5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
