<?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: Spinning command line cursor in Java and PHP</title>
	<atom:link href="http://www.4pmp.com/2010/01/spinning-command-line-cursor-in-java-and-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.4pmp.com/2010/01/spinning-command-line-cursor-in-java-and-php/</link>
	<description>PHP, MySQL, C, Java, Linux and other great after dinner speech topics</description>
	<lastBuildDate>Thu, 08 Jul 2010 07:36:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: goosejan</title>
		<link>http://www.4pmp.com/2010/01/spinning-command-line-cursor-in-java-and-php/comment-page-1/#comment-335</link>
		<dc:creator>goosejan</dc:creator>
		<pubDate>Tue, 06 Apr 2010 09:22:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.4pmp.com/?p=231#comment-335</guid>
		<description>Hi Nick,

thanks for this piece of code, it&#039;s really nice to know how to do this in php. :)

I&#039;ve modified it a bit for using it inside of a foreach loop, maybe this modification may be useful to somebody who needs spinning while walking an array or similar stuff. :)

$phases = array(&quot;&#124;&quot;, &quot;/&quot;, &quot;-&quot;, &quot;\\&quot;);
$phase = 0;

echo &quot;Spinning... &#124;&quot;;

foreach (EXPRESSION) { // could be while or for or whatever loop

// Do what you have to do, then:

if($phase == 4) $phase = 0;
printf(&#039;%s%s&#039;, chr(8), $phases[$phase]);
$phase++;
}</description>
		<content:encoded><![CDATA[<p>Hi Nick,</p>
<p>thanks for this piece of code, it&#8217;s really nice to know how to do this in php. <img src='http://www.4pmp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;ve modified it a bit for using it inside of a foreach loop, maybe this modification may be useful to somebody who needs spinning while walking an array or similar stuff. <img src='http://www.4pmp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>$phases = array(&#8220;|&#8221;, &#8220;/&#8221;, &#8220;-&#8221;, &#8220;\\&#8221;);<br />
$phase = 0;</p>
<p>echo &#8220;Spinning&#8230; |&#8221;;</p>
<p>foreach (EXPRESSION) { // could be while or for or whatever loop</p>
<p>// Do what you have to do, then:</p>
<p>if($phase == 4) $phase = 0;<br />
printf(&#8216;%s%s&#8217;, chr(8), $phases[$phase]);<br />
$phase++;<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
