if else statement in one line php code example
Example 1: write if and else in one line php
$result = ($data->status == 1) ? 'active' : 'disable'
Example 2: one lin if statement php
<?php if ($requestVars->_name == '') echo $redText; ?>
$result = ($data->status == 1) ? 'active' : 'disable'
<?php if ($requestVars->_name == '') echo $redText; ?>