ternarniy operator php code example
Example 1: php ternary operator
(Condition) ? (Statement1) : (Statement2);
Example 2: ternary operator in php
<?php
$marks=40;
print ($marks>=40) ? "pass" : "Fail";
?>
(Condition) ? (Statement1) : (Statement2);
<?php
$marks=40;
print ($marks>=40) ? "pass" : "Fail";
?>