<?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>Problems to Solve &#187; ajax</title>
	<atom:link href="http://problemstosolve.com/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://problemstosolve.com</link>
	<description>A Blog dedicated to solving problems.</description>
	<lastBuildDate>Fri, 12 Mar 2010 05:49:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Comet with PHP 4 [solved]</title>
		<link>http://problemstosolve.com/2007/08/13/comet-with-php-4-solved/</link>
		<comments>http://problemstosolve.com/2007/08/13/comet-with-php-4-solved/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 04:32:14 +0000</pubDate>
		<dc:creator>jordan314</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[comet]]></category>
		<category><![CDATA[solved]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://problemstosolve.com/computers/comet-with-php-4-solved/</guid>
		<description><![CDATA[I&#8217;m beginning to work with comet (an ajax-like technology that uses a single connection with multiple server pushes) and found this tutorial extremely helpful:
http://www.zeitoun.net/index.php?2007/06/22/46-how-to-implement-comet-with-php
However, I had to modify the code slightly to work with PHP 4, which doesn&#8217;t support json_encode. Instead I just returned the json array manually:

// return a json array
//$response = array();
//$response['msg']  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m beginning to work with comet (an ajax-like technology that uses a single connection with multiple server pushes) and found this tutorial extremely helpful:<br />
<a href="http://www.zeitoun.net/index.php?2007/06/22/46-how-to-implement-comet-with-php">http://www.zeitoun.net/index.php?2007/06/22/46-how-to-implement-comet-with-php</a></p>
<p>However, I had to modify the code slightly to work with PHP 4, which doesn&#8217;t support json_encode. Instead I just returned the json array manually:</p>
<pre>
<code>// return a json array
//$response = array();
//$response['msg']       = file_get_contents($filename);
//$response['timestamp'] = $currentmodif;
//echo json_encode($response);
echo "{&amp;92;"msg&amp;92;":&amp;92;"" . file_get_contents($filename) . "&amp;92;",&amp;92;"timestamp&amp;92;":" . $currentmodif . "}";
flush();</code>
</pre>
<p>I don&#8217;t know enough french to navigate or comment on Zeitoun&#8217;s site so I thought I&#8217;d at least publish this here.</p>
<p>-edit-<br />
Hmm, my code markup plugin seems to be deleting backslashes. I tried replacing them with &amp;92; but they just look like &amp;92;. So replace all &amp;92;s above with \.</p>
]]></content:encoded>
			<wfw:commentRss>http://problemstosolve.com/2007/08/13/comet-with-php-4-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
