Wednesday, 19 March 2008

PHP: the ? operator

The ? in PHP is shorthand for an if..else statement. It works like this
{expression} ? return_when_expression_true : return_when_expression_false;
Notice the ? and the : to separate everything apart.

No comments: