Answers for "php ternary string"

PHP
11

php ternary operator

(Condition) ? (Statement1) : (Statement2);
Posted by: Guest on April-23-2020
3

php ternary

$result = $condition ? 'foo' : 'bar';
Posted by: Guest on September-02-2020
0

php ternary string

$if = function($test, $true, $false)
{
  return $test ? $true : $false;
};

echo "class='{$if(true, 'abc', 'def')}'";
Posted by: Guest on October-01-2021

Browse Popular Code Answers by Language