If anyone says ternary operators aren't useful they aren't schooled properly in the art of programming. Either way, short of minifying your code, it's good practice not to get too complicated with it. Your second example is getting difficult to understand, and anything beyond that even moreso.
The syntax is fairly universal in other languages.
Results 1 to 6 of 6
Thread: PHP Ternary operator
Threaded View
- 25 Oct. 2010 07:33am #4