Announcement
iPhone DZone: Fresh Links On Your iPhone by matt at Sat Jul 05 14:09:51 EDT 2008
Reading DZone on your iPhone just got a little bit easier. Visit http://dzone.com/iphone from your iPhone to try out our beta iPhone support. You can view stories, filter by tags, and login. We'd appreciate your feedback at feedback@dzone.com.
Your votes power DZone. Login and vote now.
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)