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:
File Upload Using Angular Js and Node Js28-05-2018 AngularJs Node js file upload multer module |
How To Get Your Blogs Posts Using Blogger API30-07-2017 blogger api json php |
Using slice remove last two characters from given string07-03-2017 slice remove |
Remove last two characters from given string06-03-2017 substring javascript remove |
Get previous date from given date in javascript06-03-2017 date javascript previous date |