if and return in one line php code example
Example 1: php inline if
/* most basic usage */
$var = 5;
$var_is_greater_than_two = ($var > 2 ? true : false); // returns true
Example 2: php if short form
<?php echo ($qte > 0) ? $qte : 0; ?>
/* most basic usage */
$var = 5;
$var_is_greater_than_two = ($var > 2 ? true : false); // returns true
<?php echo ($qte > 0) ? $qte : 0; ?>