Example for Conditional Operator in php

16-04-2017 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 insert bulk information into database in single query execution
18-03-2017 insert sql bulk database
How to upload file by using request module
18-03-2017 request module node js
How to use request module in node js
16-03-2017 request module node js
Filter for insert HTML in Angular Js
06-03-2017 filter show html angular js html
Call a function every second or 5 seconds in javascript
22-02-2017 setinterval function calling