if then else php shorthand code example
Example 1: write if and else in one line php
$result = ($data->status == 1) ? 'active' : 'disable'
Example 2: php if short form
<?php echo ($qte > 0) ? $qte : 0; ?>
$result = ($data->status == 1) ? 'active' : 'disable'
<?php echo ($qte > 0) ? $qte : 0; ?>