php if short syntax code example
Example 1: write if and else in one line php
$result = ($data->status == 1) ? 'active' : 'disable'
Example 2: php shorthand if
$is_admin = ($user['permissions'] == 'admin') ? true : false;
$result = ($data->status == 1) ? 'active' : 'disable'
$is_admin = ($user['permissions'] == 'admin') ? true : false;