<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Tech-Recipes - Latest Comments in PHP if statement syntax | PHP programming | Tech-Recipes</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><language>en</language><lastBuildDate>Sat, 22 Aug 2009 12:50:02 -0000</lastBuildDate><item><title>Re: PHP if statement syntax | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-15236171</link><description>Glad we could help!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">davak</dc:creator><pubDate>Sat, 22 Aug 2009 12:50:02 -0000</pubDate></item><item><title>Re: PHP if statement syntax | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-15055274</link><description>I am a novie in php programming.I was looking for "elseif" in php and this writ up heloped me to do it..&lt;br&gt;&lt;br&gt;Thanking you &lt;br&gt;Anand V Mohan</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 | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-9606387</link><description>My above suggestion is  the same as what Tom Elders suggested. I support it</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 | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-9606172</link><description>yes, ternary condition does give a problem&lt;br&gt;&lt;br&gt;I would advise the following as well&lt;br&gt;&lt;br&gt; while($row = mysql_fetch_row):&lt;br&gt;if($condition = true) { $something = $value } &lt;br&gt;endwhile;</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 | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-5189933</link><description>Thats a great shorthand, and gives good readability!</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 | PHP programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/288/php-if-statement-syntax/#comment-5010400</link><description>I think describing the ternary operator "?" as an if statement is a bit misleading. For example, inside a while loop:&lt;br&gt;&lt;br&gt;while($row = mysql_fetch_row):&lt;br&gt;    if($condition = true) { $something = $value }     &lt;br&gt;endwhile;&lt;br&gt;&lt;br&gt;that works. However, consider the following&lt;br&gt;&lt;br&gt;while($row = mysql_fetch_row):&lt;br&gt;    $something = ($condition = $true) ? $value : null;    &lt;br&gt;endwhile;&lt;br&gt;&lt;br&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.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tom Elders</dc:creator><pubDate>Fri, 09 Jan 2009 08:16:53 -0000</pubDate></item></channel></rss>