Try following example to understand the conditional operator.
$a = 10; $b = 20; /* If condition is true then assign a to result otheriwse b */ $result = ($a > $b ) ? $a :$b; echo $result;
Here $a is if condition and $b is in else condition.
You might also like:
A Very Big Sum | Javascript | hackerrank07-05-2020 A Very Big Sum Javascript hackerrank |
Time Sorting Ascending or Descending Order in Javascript19-07-2017 Javascript ascending order descending order |
How to get id by using name attribute in javascript20-03-2017 html id name javascript |
How to get current date and time (yyyy-mm-dd H:i:s) using javascript09-03-2017 javascript date time |
Change datepicker display format06-03-2017 datepicker angular js |