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:

Use java script file client side and server side at a time in node js

30-07-2017 node js include call javascript

How to insert bulk information into database in single query execution

18-03-2017 insert sql bulk database

How to use request module in node js

16-03-2017 request module node js

Filter for change Date Time format (MM-dd-yyyy HH:mm) in Angular Js

05-03-2017 mm-dd-yyyy HH:MM date formats angular js

Email validation regular expression in javascript

22-02-2017 email validation regex