Adsense 728 * 15

Search

Custom Search

If-Else in PHP



If-Else in PHP


if-else statement is used when we want to make choice to be made between two possible alternatives.


Example of If-Else -



<?php


$firstnumber=10;
$secondnumber=20;


 //check whether secondnumber is greater than firstnumber or not
if($firstnumber<$secondnumber) 
{
echo "Second number is greater"; //if secondnumber is greater then it print this statement
}
else
{
echo "First number is greater";
}
?>


For Loop in PHP

No comments:

Post a Comment