Monday, December 14, 2009

1:41 AM
Use the IF...ELSE statement to execute some code if a condition is true and another code if a condition is false.


Here, the condition is true then the IF statement will be executed, if the condition is false then the ELSE statement will be executed


Syntax:
if (condition)
{
  codes to be executed if condition is true;
}
else
{
  codes to be executed if condition is false;
}


Example:
$number_three = 3;


if ( $number_three == 3 ) 
{
echo "The if statement evaluated to true";
}
else
{
echo "The if statement evaluated to false";
}

0 comments: