View Single Post
Old 06-11-2008, 10:06 PM   #3 (permalink)
xenon
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

...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 == $b++ : $c++; 
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
The Following User Says Thank You to xenon For This Useful Post:
Dave (06-11-2008)