05-19-2009, 08:18 AM
|
#14 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Quote:
Originally Posted by Wildhoney
It may be worth adding that we can nest ternary operators.
It begins to get truly messy when you do this, and that's really when you should begin considering an if statement instead.
However:
php Code:
$szGender = 'M'; //$szGender = 'F';//$szGender = '';printf( 'Gender: %s', ( ! $szGender ? 'Unknown' : ($szGender == 'M' ? 'Male' : 'Female') ));
|
Wow, I understand ternary operators, but here.. you just lost me :p Perhaps because I just woke up xD
__________________
|
|
|
|