<?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: Basics of looping in PHP</title>
	<atom:link href="http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Tue, 24 Nov 2009 15:56:47 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: eRIZ</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-605137</link>
		<dc:creator>eRIZ</dc:creator>
		<pubDate>Mon, 12 Jan 2009 13:20:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-605137</guid>
		<description>&lt;blockquote&gt;While loops are very popular and useful.&lt;/blockquote&gt;
Of course, while loops are better if you don&#039;t know how many iterations you have to do (eg. SQL data fetch).

There&#039;s one detail: in C there are &lt;code&gt;$i++&lt;/code&gt; and &lt;code&gt;++$i&lt;/code&gt; constructions. The second is faster, strange. ;)

Try yourself: http://pastebin.com/f525b5c27</description>
		<content:encoded><![CDATA[<blockquote><p>While loops are very popular and useful.</p></blockquote>
<p>Of course, while loops are better if you don&#8217;t know how many iterations you have to do (eg. SQL data fetch).</p>
<p>There&#8217;s one detail: in C there are <code>$i++</code> and <code>++$i</code> constructions. The second is faster, strange. ;)</p>
<p>Try yourself: <a href="http://pastebin.com/f525b5c27" rel="nofollow">http://pastebin.com/f525b5c27</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Pataki</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-604438</link>
		<dc:creator>Daniel Pataki</dc:creator>
		<pubDate>Sun, 11 Jan 2009 20:56:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-604438</guid>
		<description>Hi eRIZ!

Thanks for that clarification! I actually didn&#039;t mean it would work, I meant that it is equivalent, although I agree, I wasn&#039;t too clear, I should have written out the proper form! I did not know it was faster though, thanks for that awesome, awesome benchmark link :) 

Hi What is PHP!

Yes, from the article: &quot;there are many tips and tricks you can use, and other modes of looping, we will get there soon though&quot;

In some cases you must (or at least it is much easier) to use while loops, if you want some rules for a specific interval in the loop. I also use foreach a lot, I will get there in due time :)</description>
		<content:encoded><![CDATA[<p>Hi eRIZ!</p>
<p>Thanks for that clarification! I actually didn&#8217;t mean it would work, I meant that it is equivalent, although I agree, I wasn&#8217;t too clear, I should have written out the proper form! I did not know it was faster though, thanks for that awesome, awesome benchmark link :) </p>
<p>Hi What is PHP!</p>
<p>Yes, from the article: &#8220;there are many tips and tricks you can use, and other modes of looping, we will get there soon though&#8221;</p>
<p>In some cases you must (or at least it is much easier) to use while loops, if you want some rules for a specific interval in the loop. I also use foreach a lot, I will get there in due time :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: What is PHP?</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-604432</link>
		<dc:creator>What is PHP?</dc:creator>
		<pubDate>Sun, 11 Jan 2009 20:47:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-604432</guid>
		<description>For loops are not the only type of loops available in PHP. While loops are very popular and useful.</description>
		<content:encoded><![CDATA[<p>For loops are not the only type of loops available in PHP. While loops are very popular and useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eRIZ</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-604374</link>
		<dc:creator>eRIZ</dc:creator>
		<pubDate>Sun, 11 Jan 2009 19:33:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-604374</guid>
		<description>&lt;blockquote&gt;I could also have written “$i + 1″.&lt;/blockquote&gt;
Nope, because &lt;code&gt;$i+1&lt;/code&gt; doesn&#039;t affect on parsed variable what &lt;code&gt;$i++&lt;/code&gt; does. Although the proper code should be &lt;code&gt;$i = $i+1&lt;/code&gt; it brings back a bad Pascal&#039;s behaviour. PHP is C based language so use C operators which are often faster than other constructions.

Take a look: http://www.php.lt/benchmark/phpbench.php

A PHP performance benchmark which tests all possible array iterating methods.</description>
		<content:encoded><![CDATA[<blockquote><p>I could also have written “$i + 1″.</p></blockquote>
<p>Nope, because <code>$i+1</code> doesn&#8217;t affect on parsed variable what <code>$i++</code> does. Although the proper code should be <code>$i = $i+1</code> it brings back a bad Pascal&#8217;s behaviour. PHP is C based language so use C operators which are often faster than other constructions.</p>
<p>Take a look: <a href="http://www.php.lt/benchmark/phpbench.php" rel="nofollow">http://www.php.lt/benchmark/phpbench.php</a></p>
<p>A PHP performance benchmark which tests all possible array iterating methods.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Pataki</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-604368</link>
		<dc:creator>Daniel Pataki</dc:creator>
		<pubDate>Sun, 11 Jan 2009 19:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-604368</guid>
		<description>Hi Angelo R.!

Thanks for the explanation! Also, I agree, php.net is the best. I also refer to it a lot, I don&#039;t have all those hundreds of built in functions in my head :) 

I too have the same exact keyword in firefox :) Although I know a lot of function names I don&#039;t always know their arguments and in which order I should put them, so this is a great quick reference!


Hi iampriteshdesai!

Sorry, but I only cover web specific topics like HTML, CSS, PHP, MySQL, Javascript, AJAX, etc. I am not that well versed in C++, while I might be able to write the program I am not sure I could do it with best practices. 

However I will have time in February, and I am scheduling some learning time for C++ anyway, if this is still an issue for you pelase email me at daniel [at symbol] hackyourday [.dot.symbol] com</description>
		<content:encoded><![CDATA[<p>Hi Angelo R.!</p>
<p>Thanks for the explanation! Also, I agree, php.net is the best. I also refer to it a lot, I don&#8217;t have all those hundreds of built in functions in my head :) </p>
<p>I too have the same exact keyword in firefox :) Although I know a lot of function names I don&#8217;t always know their arguments and in which order I should put them, so this is a great quick reference!</p>
<p>Hi iampriteshdesai!</p>
<p>Sorry, but I only cover web specific topics like HTML, CSS, PHP, MySQL, Javascript, AJAX, etc. I am not that well versed in C++, while I might be able to write the program I am not sure I could do it with best practices. </p>
<p>However I will have time in February, and I am scheduling some learning time for C++ anyway, if this is still an issue for you pelase email me at daniel [at symbol] hackyourday [.dot.symbol] com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabio</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-604355</link>
		<dc:creator>Fabio</dc:creator>
		<pubDate>Sun, 11 Jan 2009 19:19:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-604355</guid>
		<description>Dear Angelo. 

Thanks for helping!</description>
		<content:encoded><![CDATA[<p>Dear Angelo. </p>
<p>Thanks for helping!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Angelo R.</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-604235</link>
		<dc:creator>Angelo R.</dc:creator>
		<pubDate>Sun, 11 Jan 2009 17:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-604235</guid>
		<description>@Fabio: Echo essentially just prints out whatever is between the tags to the browser. So if you say 

echo &quot;Hello, World&quot;; 

when you load the page it will print out Hello, World to your browser. 

Because of this, you can actually place HTML/Javascript/CSS tags (anything that you would use when developing a website actually) into echo tags. 

http://ca.php.net/manual/en/function.echo.php

Since the PHP manual is so great (I find myself referring to it quite a bit) I actually set up a keyword search for it. So now, I can just type in php my_search_term and it automatically searches the website. I suggest any developers do that same, as it saves a lot of time when you&#039;re typing not to have to switch with a mouse.</description>
		<content:encoded><![CDATA[<p>@Fabio: Echo essentially just prints out whatever is between the tags to the browser. So if you say </p>
<p>echo &#8220;Hello, World&#8221;; </p>
<p>when you load the page it will print out Hello, World to your browser. </p>
<p>Because of this, you can actually place HTML/Javascript/CSS tags (anything that you would use when developing a website actually) into echo tags. </p>
<p><a href="http://ca.php.net/manual/en/function.echo.php" rel="nofollow">http://ca.php.net/manual/en/function.echo.php</a></p>
<p>Since the PHP manual is so great (I find myself referring to it quite a bit) I actually set up a keyword search for it. So now, I can just type in php my_search_term and it automatically searches the website. I suggest any developers do that same, as it saves a lot of time when you&#8217;re typing not to have to switch with a mouse.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabio</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-604195</link>
		<dc:creator>Fabio</dc:creator>
		<pubDate>Sun, 11 Jan 2009 16:13:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-604195</guid>
		<description>Dear Daniel! Please, could you detail me better what will the echo commando do????

In C language, I could insert a row with &quot;printf&quot; and then you should got a message on the screen. But php I don&#039;t know and even so PHP commands will interact with HTML.

Thanks,

Fabius</description>
		<content:encoded><![CDATA[<p>Dear Daniel! Please, could you detail me better what will the echo commando do????</p>
<p>In C language, I could insert a row with &#8220;printf&#8221; and then you should got a message on the screen. But php I don&#8217;t know and even so PHP commands will interact with HTML.</p>
<p>Thanks,</p>
<p>Fabius</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iampriteshdesai</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-604187</link>
		<dc:creator>iampriteshdesai</dc:creator>
		<pubDate>Sun, 11 Jan 2009 16:00:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-604187</guid>
		<description>Hi Daniel!
Will you please write an tutorial to make a simple GUI program (say a calculator) with Visual Studio C++
I want to do GUI in C++, at college we have only done console (DOS) software.</description>
		<content:encoded><![CDATA[<p>Hi Daniel!<br />
Will you please write an tutorial to make a simple GUI program (say a calculator) with Visual Studio C++<br />
I want to do GUI in C++, at college we have only done console (DOS) software.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul.</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-604055</link>
		<dc:creator>Paul.</dc:creator>
		<pubDate>Sun, 11 Jan 2009 13:03:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-604055</guid>
		<description>Thanks Daniel for this christal clear artikel, again, and not to forget, your links. Please keep up the good work. And even more references to learning websites, are very welcome. And Jojo thanks for you links.</description>
		<content:encoded><![CDATA[<p>Thanks Daniel for this christal clear artikel, again, and not to forget, your links. Please keep up the good work. And even more references to learning websites, are very welcome. And Jojo thanks for you links.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Pataki</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-603936</link>
		<dc:creator>Daniel Pataki</dc:creator>
		<pubDate>Sun, 11 Jan 2009 10:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-603936</guid>
		<description>Hi Jojo!

Thanks for those links, also W3Schools is a great palce for MANY languages, check out the site at
http://w3schools.com

I also like Your HTML Source at
http://yourhtmlsource.com

PHP actually has one of the best online manuals ever, take a look at php.net. It can be a bit daunting at first, but it&#039;s actually written very well.
http://php.net</description>
		<content:encoded><![CDATA[<p>Hi Jojo!</p>
<p>Thanks for those links, also W3Schools is a great palce for MANY languages, check out the site at<br />
<a href="http://w3schools.com" rel="nofollow">http://w3schools.com</a></p>
<p>I also like Your HTML Source at<br />
<a href="http://yourhtmlsource.com" rel="nofollow">http://yourhtmlsource.com</a></p>
<p>PHP actually has one of the best online manuals ever, take a look at php.net. It can be a bit daunting at first, but it&#8217;s actually written very well.<br />
<a href="http://php.net" rel="nofollow">http://php.net</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jojo</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-603877</link>
		<dc:creator>Jojo</dc:creator>
		<pubDate>Sun, 11 Jan 2009 09:25:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-603877</guid>
		<description>I used to do assembler, PL/1 and JCL systems programming years ago in mainframe systems.  

I&#039;ve been telling myself for years that I would someday go back to programming by learning some modern languages.  Now seems like I will finally begin to tackle this project.

Here&#039;s some links I am looking at that might be useful for others:

The Absolute Beginner&#039;s Guide to Programming on the Web
http://appjet.com/learn-to-program/lessons/intro

http://www.thefreecountry.com/

http://www.freetechbooks.com/

http://jennifermadden.com/index.html (Javascript tutorial)

Microsoft also has a lot of free resources for beginners here:
http://msdn.microsoft.com/en-us/beginner/default.aspx</description>
		<content:encoded><![CDATA[<p>I used to do assembler, PL/1 and JCL systems programming years ago in mainframe systems.  </p>
<p>I&#8217;ve been telling myself for years that I would someday go back to programming by learning some modern languages.  Now seems like I will finally begin to tackle this project.</p>
<p>Here&#8217;s some links I am looking at that might be useful for others:</p>
<p>The Absolute Beginner&#8217;s Guide to Programming on the Web<br />
<a href="http://appjet.com/learn-to-program/lessons/intro" rel="nofollow">http://appjet.com/learn-to-program/lessons/intro</a></p>
<p><a href="http://www.thefreecountry.com/" rel="nofollow">http://www.thefreecountry.com/</a></p>
<p><a href="http://www.freetechbooks.com/" rel="nofollow">http://www.freetechbooks.com/</a></p>
<p><a href="http://jennifermadden.com/index.html" rel="nofollow">http://jennifermadden.com/index.html</a> (Javascript tutorial)</p>
<p>Microsoft also has a lot of free resources for beginners here:<br />
<a href="http://msdn.microsoft.com/en-us/beginner/default.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/beginner/default.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ME</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-603851</link>
		<dc:creator>ME</dc:creator>
		<pubDate>Sun, 11 Jan 2009 08:55:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-603851</guid>
		<description>whoops

vb
for i as Integer = 0 to 99
  msgbox “hello world”
next i</description>
		<content:encoded><![CDATA[<p>whoops</p>
<p>vb<br />
for i as Integer = 0 to 99<br />
  msgbox “hello world”<br />
next i</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ME</title>
		<link>http://www.ghacks.net/2009/01/11/basics-of-looping-in-php/#comment-603835</link>
		<dc:creator>ME</dc:creator>
		<pubDate>Sun, 11 Jan 2009 08:40:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghacks.net/?p=9797#comment-603835</guid>
		<description>FOR LOOPS

php
for($i=0; $i=99; $i++){
echo &#039;why post about this, let them learn the hard way :)&#039;;
}

vb
for i as string = 0 to 99
  msgbox &quot;hello world&quot;
next i

c#

for (int i = 1; i &lt;= 10; i++)
{
  MessageBox.Show(&quot;Hello World&quot;);
}</description>
		<content:encoded><![CDATA[<p>FOR LOOPS</p>
<p>php<br />
for($i=0; $i=99; $i++){<br />
echo &#8216;why post about this, let them learn the hard way :)&#8217;;<br />
}</p>
<p>vb<br />
for i as string = 0 to 99<br />
  msgbox &#8220;hello world&#8221;<br />
next i</p>
<p>c#</p>
<p>for (int i = 1; i &lt;= 10; i++)<br />
{<br />
  MessageBox.Show(&#8221;Hello World&#8221;);<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
