It's called the ternary operator, and its an expression, if / else if / else are control structures, so technically it isn't just a shortcut for if/else
The manual shows an example like this:
<?php
$first ? $second : $third;
?>
Each of the variables represents a sub expression,
If the value $first subexpression evaluates to TRUE, the code contained in $second subexpression is evaluated if the $first subexpression evaluates as FALSE the $third subexpression is evaluated. Commonly you'll find this in a use that is representable by a simple if/else structure.
if ($foo == TRUE) {
$bar = 1;
} else {
$bar = 0;
}
Is the same thing as saying:
$bar = ($foo == TRUE)? 1 : 0;
You can find it in the PHP manual here:
http://www.php.net/manual/en/language.expressions.php
Regards,
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::