By davidwalsh
via davidwalsh.name
Published: Dec 18 2007 / 10:13
In looking at my Google Analytics statistics, I see a lot of visitors searching for PHP shorthand if/else (ternary) information. I've gone through my code library and picked out some examples of ternary operator usage.
SaveShareSend
Tags: how-to, javascript, other languages, php
Comments
harlan replied ago:
Nice post dwizzle
dragmire replied ago:
Ternary ifs are difficult to read. Avoid unless you can somehow make it easier.
Voters For This Link (12)
Voters Against This Link (1)