<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Tech-Recipes - Latest Comments in PHP if statement syntax</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><atom:link href="https://tech-recipes.disqus.com/php_if_statement_syntax_php_programming_tech_recipes/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 24 Sep 2010 23:26:59 -0000</lastBuildDate><item><title>Re: PHP if statement syntax</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-80704214</link><description>&lt;p&gt;This is great!!! Nway, is there any way to shorthand the nested if statement?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bajick</dc:creator><pubDate>Fri, 24 Sep 2010 23:26:59 -0000</pubDate></item><item><title>Re: PHP if statement syntax</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-78809720</link><description>&lt;p&gt;Done a excellent job in this blog, Alternatively create a great blog for the readers specially for PHP programming. Thanks.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">php programming</dc:creator><pubDate>Sat, 18 Sep 2010 06:34:08 -0000</pubDate></item><item><title>Re: PHP if statement syntax</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-15055274</link><description>&lt;p&gt;I am a novie in php programming.I was looking for "elseif" in php and this writ up heloped me to do it..&lt;/p&gt;&lt;p&gt;Thanking you &lt;br&gt;Anand V Mohan&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Name</dc:creator><pubDate>Wed, 19 Aug 2009 08:59:42 -0000</pubDate></item><item><title>Re: PHP if statement syntax</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-9606387</link><description>&lt;p&gt;My above suggestion is  the same as what Tom Elders suggested. I support it&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sagar </dc:creator><pubDate>Wed, 20 May 2009 19:44:22 -0000</pubDate></item><item><title>Re: PHP if statement syntax</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-9606172</link><description>&lt;p&gt;yes, ternary condition does give a problem&lt;/p&gt;&lt;p&gt;I would advise the following as well&lt;/p&gt;&lt;p&gt; while($row = mysql_fetch_row):&lt;br&gt;if($condition = true) { $something = $value } &lt;br&gt;endwhile;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sagar </dc:creator><pubDate>Wed, 20 May 2009 19:35:43 -0000</pubDate></item><item><title>Re: PHP if statement syntax</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-5189933</link><description>&lt;p&gt;Thats a great shorthand, and gives good readability!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">peace love</dc:creator><pubDate>Fri, 16 Jan 2009 15:53:51 -0000</pubDate></item><item><title>Re: PHP if statement syntax</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-5010400</link><description>&lt;p&gt;I think describing the ternary operator "?" as an if statement is a bit misleading. For example, inside a while loop:&lt;/p&gt;&lt;p&gt;while($row = mysql_fetch_row):&lt;br&gt;    if($condition = true) { $something = $value }     &lt;br&gt;endwhile;&lt;/p&gt;&lt;p&gt;that works. However, consider the following&lt;/p&gt;&lt;p&gt;while($row = mysql_fetch_row):&lt;br&gt;    $something = ($condition = $true) ? $value : null;    &lt;br&gt;endwhile;&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">gargantuan</dc:creator><pubDate>Fri, 09 Jan 2009 08:16:53 -0000</pubDate></item></channel></rss>