That's called the ternary operator, it's an expression. You can find it in the PHP manual here:
http://www.php.net/manual/en/language.expressions.php
What happens is there are three subexpressions within the expression
$first? $second : $third;
The $first evaluates to a simple boolean. If it's true, the second subexpression is evaluated, which is the $second variable in the above example. If the $first subexpression evaluates to false, the third subexpression is evaluated.
Often times this can be represented in an identical if/else chain.
The ternary expression:
$foo = ($_POST['field'])? true : false;
is the same as this if/else chain:
if ($_POST['field'])
{
$foo = true;
}
else
{
$foo = false;
}
HTH!
Regards,
Rich
--
[
http://www.smilingsouls.net]
[
http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail