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 Get Your Blogs Posts Using Blogger API

30-07-2017 blogger api json php

How to use http-post request in node js

14-03-2017 http-post module node js

Using slice remove last two characters from given string

07-03-2017 slice remove

Get next date from given date in javascript

06-03-2017 date javascript next date

Get random strings from given string In javascript

21-02-2017 javascript random string