PHP ternär
$result = $condition ? 'foo' : 'bar';
Distinct Dolphin
$result = $condition ? 'foo' : 'bar';
$if = function($test, $true, $false)
{
return $test ? $true : $false;
};
echo "class='{$if(true, 'abc', 'def')}'";