php inline if
snippet in php

php inline if

user3542

/* most basic usage */
$var = 5;
$var_is_greater_than_two = ($var > 2 ? true : false); // returns true

write if and else in one line php

user6750

$result = ($data->status == 1) ? 'active' : 'disable'

one lin if statement php

user7088

<?php if ($requestVars->_name == '') echo $redText; ?>