PHP

Ternary operator in PHP


Conditions without switch or if. Ternary operador. Condition with ?

Code example of ternary operator

Example of ternary operator in PHP

<?php

$condition = true;

$result = "";


$condition ? $result="true" : $result= "false";


echo  $condition . " gives a result ". $result;