Here is the syntax for single line if else statement in PHP.
<?php $x=15; $y=10; $val=($x<$y)?"Correct":"Incorrect"; echo $val;//Outputs Incorrect ?>
Cheers,
JENSon.
Facts n Thoughts!
Here is the syntax for single line if else statement in PHP.
<?php $x=15; $y=10; $val=($x<$y)?"Correct":"Incorrect"; echo $val;//Outputs Incorrect ?>
Cheers,
JENSon.