<?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"
	>
<channel>
	<title>Comments on: Control Structures</title>
	<atom:link href="http://mgeisler.net/php-tutorial/control-structures/feed/" rel="self" type="application/rss+xml" />
	<link>http://mgeisler.net</link>
	<description>Adventures with Computers</description>
	<pubDate>Thu, 21 Aug 2008 18:17:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6-bleeding</generator>
		<item>
		<title>By: Martin Geisler</title>
		<link>http://mgeisler.net/php-tutorial/control-structures/#comment-134439</link>
		<dc:creator>Martin Geisler</dc:creator>
		<pubDate>Thu, 29 Nov 2007 07:31:04 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/php-tutorial/control-structures/#comment-134439</guid>
		<description>&lt;p&gt;9: Yeah, you're right! Thanks for pointing it out, I'll update the text.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>9: Yeah, you&#8217;re right! Thanks for pointing it out, I&#8217;ll update the text.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mickeystinge</title>
		<link>http://mgeisler.net/php-tutorial/control-structures/#comment-134421</link>
		<dc:creator>mickeystinge</dc:creator>
		<pubDate>Thu, 29 Nov 2007 03:45:10 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/php-tutorial/control-structures/#comment-134421</guid>
		<description>&lt;p&gt;In your example of boolean operations in the If structure section... 
   if (($x == 0 &#38;&#38; $y != 0) &#124;&#124; ($x != 0 &#38;&#38; $y == 0)) {
       // At least one of $x and $y is zero.
   }
...surely this is not '// At least one of $x and $y is zero' but true if only one of x or y is zero, but not both ie an exclusive OR function. You would need to code... 
   if (($x == 0 &#38;&#38; $y != 0) &#124;&#124; ($x != 0 &#38;&#38; $y == 0) &#124;&#124; ($x == 0 &#38;&#38; $y == 0))
...or simply...
   if (($x ==0) &#124;&#124; ($y == 0))
...am I right?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>In your example of boolean operations in the If structure section&#8230;<br />
   if (($x == 0 &amp;&amp; $y != 0) || ($x != 0 &amp;&amp; $y == 0)) {<br />
       // At least one of $x and $y is zero.<br />
   }<br />
&#8230;surely this is not &#8216;// At least one of $x and $y is zero&#8217; but true if only one of x or y is zero, but not both ie an exclusive OR function. You would need to code&#8230;<br />
   if (($x == 0 &amp;&amp; $y != 0) || ($x != 0 &amp;&amp; $y == 0) || ($x == 0 &amp;&amp; $y == 0))<br />
&#8230;or simply&#8230;<br />
   if (($x ==0) || ($y == 0))<br />
&#8230;am I right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea</title>
		<link>http://mgeisler.net/php-tutorial/control-structures/#comment-50555</link>
		<dc:creator>Andrea</dc:creator>
		<pubDate>Thu, 01 Mar 2007 16:57:58 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/php-tutorial/control-structures/#comment-50555</guid>
		<description>&lt;p&gt;I like it and the background and colors make it easy to readn&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I like it and the background and colors make it easy to readn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elias_Maluco</title>
		<link>http://mgeisler.net/php-tutorial/control-structures/#comment-383</link>
		<dc:creator>Elias_Maluco</dc:creator>
		<pubDate>Wed, 27 Jul 2005 21:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/php-tutorial/control-structures/#comment-383</guid>
		<description>&lt;p&gt;Yes, thank you very much. And I found where you explained about the =&#62;, I just have the bad habbit of jumping sentences while I read. Sorry about that.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yes, thank you very much. And I found where you explained about the =&gt;, I just have the bad habbit of jumping sentences while I read. Sorry about that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Geisler</title>
		<link>http://mgeisler.net/php-tutorial/control-structures/#comment-382</link>
		<dc:creator>Martin Geisler</dc:creator>
		<pubDate>Wed, 27 Jul 2005 21:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/php-tutorial/control-structures/#comment-382</guid>
		<description>&lt;p&gt;I've tried to explain the &lt;code&gt;=&#62;&lt;/code&gt; syntax in the text, please tell me if that helps or if I could explain it better.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve tried to explain the <code>=&gt;</code> syntax in the text, please tell me if that helps or if I could explain it better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Geisler</title>
		<link>http://mgeisler.net/php-tutorial/control-structures/#comment-381</link>
		<dc:creator>Martin Geisler</dc:creator>
		<pubDate>Wed, 27 Jul 2005 21:08:15 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/php-tutorial/control-structures/#comment-381</guid>
		<description>&lt;p&gt;(I've edited your comment to include the &#60;br&#62; that got deleted --- HTML tags are not allowed comments, but I had expected them to be escaped...)&lt;/p&gt;

&lt;p&gt;As for your question: when looking for the "\n" are you looking at the source of your document?  It is only there you'll see the "\n". All whitespace are treated like a single space in HTML, so your newlines, tabs, carrige returns, and a bit more are all turned into a single space when displayed by the browser.&lt;/p&gt;

&lt;p&gt;The exception to this is content within &lt;code&gt;&#60;pre&#62;&lt;/code&gt; tags.  There your formatting is preserved.  Was that your problem?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>(I&#8217;ve edited your comment to include the &lt;br&gt; that got deleted &#8212; HTML tags are not allowed comments, but I had expected them to be escaped&#8230;)</p>
<p>As for your question: when looking for the &#8220;\n&#8221; are you looking at the source of your document?  It is only there you&#8217;ll see the &#8220;\n&#8221;. All whitespace are treated like a single space in HTML, so your newlines, tabs, carrige returns, and a bit more are all turned into a single space when displayed by the browser.</p>
<p>The exception to this is content within <code>&lt;pre&gt;</code> tags.  There your formatting is preserved.  Was that your problem?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elias_Maluco</title>
		<link>http://mgeisler.net/php-tutorial/control-structures/#comment-377</link>
		<dc:creator>Elias_Maluco</dc:creator>
		<pubDate>Wed, 27 Jul 2005 20:50:40 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/php-tutorial/control-structures/#comment-377</guid>
		<description>&lt;p&gt;Also, \n is simply not working here. Im using Apache 2.0.54 and PHP 5.0.4 in Windows XP. When a put \n in a string, it doenst get echoed, but it doesnt break the line neither. So, Ive been using  instead. &lt;/p&gt;

&lt;p&gt;So, if I try:
echo "Two\nlines"; I get simply "Two lines" printed on the page.
I have to write "Two&#60;br&#62;lines"; to achieve the same effect;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Also, \n is simply not working here. Im using Apache 2.0.54 and PHP 5.0.4 in Windows XP. When a put \n in a string, it doenst get echoed, but it doesnt break the line neither. So, Ive been using  instead. </p>
<p>So, if I try:<br />
echo &#8220;Two\nlines&#8221;; I get simply &#8220;Two lines&#8221; printed on the page.<br />
I have to write &#8220;Two&lt;br&gt;lines&#8221;; to achieve the same effect;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elias_Maluco</title>
		<link>http://mgeisler.net/php-tutorial/control-structures/#comment-376</link>
		<dc:creator>Elias_Maluco</dc:creator>
		<pubDate>Wed, 27 Jul 2005 20:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/php-tutorial/control-structures/#comment-376</guid>
		<description>&lt;p&gt;Sorry, but could you explain what the "=&#62;" operator does? You just started using it, but I cant find where do you explained anything about it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Sorry, but could you explain what the &#8220;=&gt;&#8221; operator does? You just started using it, but I cant find where do you explained anything about it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Geisler</title>
		<link>http://mgeisler.net/php-tutorial/control-structures/#comment-362</link>
		<dc:creator>Martin Geisler</dc:creator>
		<pubDate>Mon, 18 Jul 2005 19:23:23 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/php-tutorial/control-structures/#comment-362</guid>
		<description>&lt;p&gt;The table code produces the following &lt;a href="http://www.w3.org/MarkUp/" title="HyperText Markup Language" rel="nofollow"&gt;HTML&lt;/a&gt; code, no more, no less:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&#60;table&#62;
&#60;tr&#62;
  &#60;th&#62;Key&#60;/th&#62;
  &#60;th&#62;Value&#60;/th&#62;
&#60;/tr&#62;
&#60;tr&#62;
  &#60;td&#62;Foo&#60;/td&#62;
  &#60;td&#62;42&#60;/td&#62;
&#60;/tr&#62;
&#60;tr&#62;
  &#60;td&#62;Bar&#60;/td&#62;
  &#60;td&#62;3.14&#60;/td&#62;
&#60;/tr&#62;
&#60;tr&#62;
  &#60;td&#62;Baz&#60;/td&#62;
  &#60;td&#62;2.71&#60;/td&#62;
&#60;/tr&#62;
&#60;/table&#62;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This HTML code should produce a table similar to the one described above but with no border --- adding &lt;code&gt;border="1"&lt;/code&gt; to the &lt;code&gt;&#60;table&#62;&lt;/code&gt; tag will give you a border.  This has actually nothing with PHP to do, it is a matter of HTML. (Not that this makes the mismatch between the code and the example better --- I'll update the code now.)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The table code produces the following <a href="http://www.w3.org/MarkUp/" title="HyperText Markup Language" rel="nofollow">HTML</a> code, no more, no less:</p>
<pre><code>&lt;table&gt;
&lt;tr&gt;
  &lt;th&gt;Key&lt;/th&gt;
  &lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Foo&lt;/td&gt;
  &lt;td&gt;42&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Bar&lt;/td&gt;
  &lt;td&gt;3.14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;Baz&lt;/td&gt;
  &lt;td&gt;2.71&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</code></pre>
<p>This HTML code should produce a table similar to the one described above but with no border &#8212; adding <code>border="1"</code> to the <code>&lt;table&gt;</code> tag will give you a border.  This has actually nothing with PHP to do, it is a matter of HTML. (Not that this makes the mismatch between the code and the example better &#8212; I&#8217;ll update the code now.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Davis</title>
		<link>http://mgeisler.net/php-tutorial/control-structures/#comment-354</link>
		<dc:creator>Jim Davis</dc:creator>
		<pubDate>Sat, 16 Jul 2005 15:01:30 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/php-tutorial/control-structures/#comment-354</guid>
		<description>&lt;p&gt;I tried the above table code as it was but it wasn't until I changed it to:&lt;/p&gt;

&lt;p&gt;echo "\n";&lt;/p&gt;

&lt;p&gt;that it actually showed the table. Is that normal? I tried it the other way but it just showed the numbers but no table I had to add the border= to get the table to show.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I tried the above table code as it was but it wasn&#8217;t until I changed it to:</p>
<p>echo &#8220;\n&#8221;;</p>
<p>that it actually showed the table. Is that normal? I tried it the other way but it just showed the numbers but no table I had to add the border= to get the table to show.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
