RSS FeedFebruary 17th, 2009
Short cut if statement in PHP
Surprisingly, I still come across quite a few “long cut if statements” of the following form:
if ($var1 == $var2) echo ” selected”;
It is of course much easier to say, and much easier to read:
echo ($var1 == $var2 ? ” selected” : “”);
Apps