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:
How to use http-post request in node js14-03-2017 http-post module node js |
Convert Time 24 hrs to 12 hrs format In javascript12-03-2017 date javascript 12hrs convert |
Get next date from given date in javascript06-03-2017 date javascript next date |
Filter for replace text in Angular Js05-03-2017 filter replace angular js |
Call a function every second or 5 seconds in javascript22-02-2017 setinterval function calling |