Wednesday, July 3, 2013

Muliple if else statment in PHP with example

<?php

if($x > $y):
    echo $x." is greater than ".$b;
else if($x == $y):
    echo " above  causes a parse error.";
endif;



if($x > $y):
    echo $x." is greater than ".$y;
elseif($x == $y):
    echo $x." equals ".$y;
else:
    echo $x." is neither greater than or equal to ".$y;
endif;

?>

No comments: