06-11-2008, 10:06 PM
|
#3 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
...so basically, leaving the tech terms out, it works like an if-else statement (not only works, but it is exactly that). The following statement:
PHP Code:
if($a == 1) { $b++; } else { $c++; }
can be translated using the ternary operator into:
PHP Code:
$a == 1 ? $b++ : $c++;
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
|
|
|
|