php shorthand if
snippet in php

php shorthand if

user9064

$is_admin = ($user['permissions'] == 'admin') ? true : false;

php ternary shorthand

user3919

$y = $x ? "true" : "false";