<?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: The PHP for() loop</title>
	<atom:link href="http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/</link>
	<description>PHP, WordPress and Business Ramblings</description>
	<lastBuildDate>Thu, 02 Feb 2012 19:31:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Ryan Harne</title>
		<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/comment-page-1/#comment-19694</link>
		<dc:creator>Ryan Harne</dc:creator>
		<pubDate>Sat, 02 Apr 2011 10:45:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/#comment-19694</guid>
		<description>Thanks! it&#039;s works well!</description>
		<content:encoded><![CDATA[<p>Thanks! it&#039;s works well!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ANAT</title>
		<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/comment-page-1/#comment-19673</link>
		<dc:creator>ANAT</dc:creator>
		<pubDate>Wed, 30 Mar 2011 05:57:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/#comment-19673</guid>
		<description>Thanks for &quot;print $$temp.&quot;&quot;
Thanks for your answer</description>
		<content:encoded><![CDATA[<p>Thanks for &#034;print $$temp.&#034;"<br />
Thanks for your answer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emil</title>
		<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/comment-page-1/#comment-19034</link>
		<dc:creator>Emil</dc:creator>
		<pubDate>Sun, 23 Jan 2011 18:07:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/#comment-19034</guid>
		<description>Every time I tried to paste the code it came up garbled. But I was able to resolve it, wrong pointers.

Thanks for your response.</description>
		<content:encoded><![CDATA[<p>Every time I tried to paste the code it came up garbled. But I was able to resolve it, wrong pointers.</p>
<p>Thanks for your response.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sarah</title>
		<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/comment-page-1/#comment-19030</link>
		<dc:creator>Sarah</dc:creator>
		<pubDate>Sun, 23 Jan 2011 17:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/#comment-19030</guid>
		<description>Sorry Emil but I&#039;m not sure what you&#039;re tried to do and your for loop isn&#039;t correct either.</description>
		<content:encoded><![CDATA[<p>Sorry Emil but I&#039;m not sure what you&#039;re tried to do and your for loop isn&#039;t correct either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emil</title>
		<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/comment-page-1/#comment-18852</link>
		<dc:creator>Emil</dc:creator>
		<pubDate>Sat, 08 Jan 2011 22:10:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/#comment-18852</guid>
		<description>I have the following:

for ( $i = 1; $iparent_cost$i&quot;;
	$tcc = &quot;this-&gt;child_cost$i&quot;;
	$cst = &quot;cost$i&quot;; 
	if ( $this-&gt;;parent_cost1 &gt; $this-&gt;child_cost1 ) {
		$$cst = $$tpc;
	}
	else {
		$$cst = $$tcc;
	}
	echo &quot; cost: &quot;.$cst;
}

I am at a loss as how to display the contents of $cst</description>
		<content:encoded><![CDATA[<p>I have the following:</p>
<p>for ( $i = 1; $iparent_cost$i&#034;;<br />
	$tcc = &#034;this-&gt;child_cost$i&#034;;<br />
	$cst = &#034;cost$i&#034;;<br />
	if ( $this-&gt;;parent_cost1 &gt; $this-&gt;child_cost1 ) {<br />
		$$cst = $$tpc;<br />
	}<br />
	else {<br />
		$$cst = $$tcc;<br />
	}<br />
	echo &#034; cost: &#034;.$cst;<br />
}</p>
<p>I am at a loss as how to display the contents of $cst</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/comment-page-1/#comment-18365</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 15 Nov 2010 15:27:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/#comment-18365</guid>
		<description>i had some trouble with posting my code i tried several times until i just went with it... but htanks for your answer.</description>
		<content:encoded><![CDATA[<p>i had some trouble with posting my code i tried several times until i just went with it&#8230; but htanks for your answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sarah</title>
		<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/comment-page-1/#comment-18364</link>
		<dc:creator>Sarah</dc:creator>
		<pubDate>Mon, 15 Nov 2010 15:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/#comment-18364</guid>
		<description>Hi Dan, I&#039;m a bit lost on what you&#039;re trying to do. The for loop should be written in the style of

&lt;code&gt;for ($i=1; $i&lt;$x; $i++) {
// put your loop code here
}&lt;/code&gt;

Where $x is the top limit. Of course you can modify these clauses to have something counting down instead of up etc. If that doesn&#039;t answer your question I&#039;ll need to know a bit more about what you&#039;re trying to do.</description>
		<content:encoded><![CDATA[<p>Hi Dan, I&#039;m a bit lost on what you&#039;re trying to do. The for loop should be written in the style of</p>
<p><code>for ($i=1; $i&lt;$x; $i++) {<br />
// put your loop code here<br />
}</code></p>
<p>Where $x is the top limit. Of course you can modify these clauses to have something counting down instead of up etc. If that doesn&#039;t answer your question I&#039;ll need to know a bit more about what you&#039;re trying to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/comment-page-1/#comment-18339</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 09 Nov 2010 22:37:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/#comment-18339</guid>
		<description>Hi Sarah

first of all thanks for nice site.

my question is, if it is possible access class variables with this method

i tried:

for($i=1; $i variable;

}

i don&#039;t get anything echoed
another this is, if the method you will post also can be used for class functions

THANKS for you answer ;)</description>
		<content:encoded><![CDATA[<p>Hi Sarah</p>
<p>first of all thanks for nice site.</p>
<p>my question is, if it is possible access class variables with this method</p>
<p>i tried:</p>
<p>for($i=1; $i variable;</p>
<p>}</p>
<p>i don&#039;t get anything echoed<br />
another this is, if the method you will post also can be used for class functions</p>
<p>THANKS for you answer <img src='http://www.stuffbysarah.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sarah</title>
		<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/comment-page-1/#comment-17884</link>
		<dc:creator>Sarah</dc:creator>
		<pubDate>Wed, 15 Sep 2010 09:32:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/#comment-17884</guid>
		<description>Hi Mich,

Yes you can. If you take the second code sample above but instead of giving $temp the value of &quot;name&quot;.$i you would use &quot;temp&quot;.$i and then assign $$temp the value of &quot;name&quot;.$i or whatever you wanted to assign to it.

Then after the loop you&#039;d have $temp1, $temp2 etc.

eg.

&lt;code&gt;
for ($i=1; $i &lt; $num_fields; $i++) {
$temp = &quot;temp&quot;.$i;
$$temp = &quot;name&quot;.$i;
}
&lt;/code&gt;

And then $temp1 equals name1, $temp2 equals name2 etc.&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hi Mich,</p>
<p>Yes you can. If you take the second code sample above but instead of giving $temp the value of &#034;name&#034;.$i you would use &#034;temp&#034;.$i and then assign $$temp the value of &#034;name&#034;.$i or whatever you wanted to assign to it.</p>
<p>Then after the loop you&#039;d have $temp1, $temp2 etc.</p>
<p>eg.</p>
<p><code><br />
for ($i=1; $i < $num_fields; $i++) {<br />
$temp = "temp".$i;<br />
$$temp = "name".$i;<br />
}<br />
</code></p>
<p>And then $temp1 equals name1, $temp2 equals name2 etc.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mich</title>
		<link>http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/comment-page-1/#comment-17868</link>
		<dc:creator>Mich</dc:creator>
		<pubDate>Mon, 13 Sep 2010 21:26:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.stuffbysarah.net/2006/01/28/the-php-for-loop/#comment-17868</guid>
		<description>Hi!

Is it possible to give &#039;$temp&#039; also a number?

So that you have:

$temp1 = &quot;name&quot;.$i;
$temp2 = &quot;name&quot;.$i;
$temp3 = &quot;name&quot;.$i;
$temp4 = &quot;name&quot;.$i;
...

I would like to use those variables also after the loop. :-)</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Is it possible to give &#039;$temp&#039; also a number?</p>
<p>So that you have:</p>
<p>$temp1 = &#034;name&#034;.$i;<br />
$temp2 = &#034;name&#034;.$i;<br />
$temp3 = &#034;name&#034;.$i;<br />
$temp4 = &#034;name&#034;.$i;<br />
&#8230;</p>
<p>I would like to use those variables also after the loop. <img src='http://www.stuffbysarah.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

