The ternary conditional operator is of the form:

(expr1) ? (expr2) : (expr3)

If expression 1 evaluates to be TRUE the above evaluates to expression 2 else expression3.

Example:

$message = ($val = "60") ? "First class" : "Second class!";

Posted in: PHP

Related FAQ's

Marius Ion ANGEL HOT SOFT LLC (800) 316-7677