Example for Conditional Operator in php

php
Conditional Operator
example

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 js

14-03-2017 http-post module node js

Navigate to another page using java script

06-03-2017 javascript redirection navigation

Change datepicker display format

06-03-2017 datepicker angular js

How to find Angular Errors

06-03-2017 errors angularjs exceptionHandler

How to remove last / value from url in javascript

27-02-2017 array javascript last value