write if and else in one line php
snippet in php

php inline if

user300

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

write if and else in one line php

user8758

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

one lin if statement php

user1674

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