php inline pokud
/* most basic usage */
$var = 5;
$var_is_greater_than_two = ($var > 2 ? true : false); // returns true
php ternární operátor
<?php
#Syntex
(if Condition) ? (stat1) : (stat2);
#example
$var1 = 5;
$var2 = 2;
echo $check = ($var1 > $var2) ? "right" : "wrong";
#output : right
/*
explination : if condition is true then display the stat1 and if condition is
worng then display stat2
*/
?>
zkratka pokud php
$is_admin = ($user['permissions'] == 'admin') ? true : false;
napište if a else do jednoho řádku php
$result = ($data->status == 1) ? 'active' : 'disable'
ternární výrazy php
$result = $condition ? 'foo' : 'bar';
pokud jinak, pokud ternární php
var name = (variable === 1) ? 'foo' : ((variable === 2) ? 'bar' : 'baz');