<?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: PHP if statement syntax</title>
	<atom:link href="http://www.tech-recipes.com/rx/288/php-if-statement-syntax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/</link>
	<description>Computer and technology tutorials and guides</description>
	<lastBuildDate>Thu, 09 Feb 2012 21:01:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: bajick</title>
		<link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/comment-page-1/#comment-42651</link>
		<dc:creator>bajick</dc:creator>
		<pubDate>Sat, 25 Sep 2010 03:26:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-42651</guid>
		<description>This is great!!! Nway, is there any way to shorthand the nested if statement?</description>
		<content:encoded><![CDATA[<p>This is great!!! Nway, is there any way to shorthand the nested if statement?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: php programming</title>
		<link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/comment-page-1/#comment-42496</link>
		<dc:creator>php programming</dc:creator>
		<pubDate>Sat, 18 Sep 2010 10:34:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-42496</guid>
		<description>Done a excellent job in this blog, Alternatively create a great blog for the readers specially for PHP programming. Thanks.</description>
		<content:encoded><![CDATA[<p>Done a excellent job in this blog, Alternatively create a great blog for the readers specially for PHP programming. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: davak</title>
		<link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/comment-page-1/#comment-32774</link>
		<dc:creator>davak</dc:creator>
		<pubDate>Sat, 22 Aug 2009 16:50:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-32774</guid>
		<description>Glad we could help!</description>
		<content:encoded><![CDATA[<p>Glad we could help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Name</title>
		<link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/comment-page-1/#comment-32713</link>
		<dc:creator>Name</dc:creator>
		<pubDate>Wed, 19 Aug 2009 12:59:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-32713</guid>
		<description>I am a novie in php programming.I was looking for &quot;elseif&quot; in php and this writ up heloped me to do it..

Thanking you 
Anand V Mohan</description>
		<content:encoded><![CDATA[<p>I am a novie in php programming.I was looking for &#8220;elseif&#8221; in php and this writ up heloped me to do it..</p>
<p>Thanking you<br />
Anand V Mohan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sagar</title>
		<link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/comment-page-1/#comment-30395</link>
		<dc:creator>Sagar</dc:creator>
		<pubDate>Wed, 20 May 2009 23:44:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-30395</guid>
		<description>My above suggestion is  the same as what Tom Elders suggested. I support it</description>
		<content:encoded><![CDATA[<p>My above suggestion is  the same as what Tom Elders suggested. I support it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sagar</title>
		<link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/comment-page-1/#comment-30394</link>
		<dc:creator>Sagar</dc:creator>
		<pubDate>Wed, 20 May 2009 23:35:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-30394</guid>
		<description>yes, ternary condition does give a problem

I would advise the following as well

 while($row = mysql_fetch_row):
if($condition = true) { $something = $value } 
endwhile;</description>
		<content:encoded><![CDATA[<p>yes, ternary condition does give a problem</p>
<p>I would advise the following as well</p>
<p> while($row = mysql_fetch_row):<br />
if($condition = true) { $something = $value }<br />
endwhile;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peace love</title>
		<link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/comment-page-1/#comment-27098</link>
		<dc:creator>peace love</dc:creator>
		<pubDate>Fri, 16 Jan 2009 20:53:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-27098</guid>
		<description>Thats a great shorthand, and gives good readability!</description>
		<content:encoded><![CDATA[<p>Thats a great shorthand, and gives good readability!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Elders</title>
		<link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/comment-page-1/#comment-26889</link>
		<dc:creator>Tom Elders</dc:creator>
		<pubDate>Fri, 09 Jan 2009 13:16:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-26889</guid>
		<description>I think describing the ternary operator &quot;?&quot; as an if statement is a bit misleading. For example, inside a while loop:

while($row = mysql_fetch_row):
    if($condition = true) { $something = $value }     
endwhile;

that works. However, consider the following

while($row = mysql_fetch_row):
    $something = ($condition = $true) ? $value : null;    
endwhile;

If the condition is met, everything works fine, but on the next iteration of the loop, if the condition is not met, $something is set to null, which is probably not the desired effect 9 times out of 10.</description>
		<content:encoded><![CDATA[<p>I think describing the ternary operator &#8220;?&#8221; as an if statement is a bit misleading. For example, inside a while loop:</p>
<p>while($row = mysql_fetch_row):<br />
    if($condition = true) { $something = $value }<br />
endwhile;</p>
<p>that works. However, consider the following</p>
<p>while($row = mysql_fetch_row):<br />
    $something = ($condition = $true) ? $value : null;<br />
endwhile;</p>
<p>If the condition is met, everything works fine, but on the next iteration of the loop, if the condition is not met, $something is set to null, which is probably not the desired effect 9 times out of 10.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached (User agent is rejected)
Database Caching 2/15 queries in 0.984 seconds using memcached
Object Caching 380/384 objects using memcached

Served from: www.tech-recipes.com @ 2012-02-10 00:26:52 -->
