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 |
Convert and download html to pdf without saving file28-10-2018 node js convert html to pdf pdf download pdf without saving |
File Upload Using Angular Js and Node Js28-05-2018 AngularJs Node js file upload multer module |
Detect AdBlock with JavaScript in my browser30-07-2017 AdBlock javascript detect |
Time Sorting Ascending or Descending Order in Javascript19-07-2017 Javascript ascending order descending order |