And Else enable to quickly execute a script when the condition fails.
PHP Code:
<?php
$myname = "Smith" ;
if ( $myname == "Smith" ) {
echo "hello ! Your are Smith"; // wil be displayed only if condition is true
} else {
echo "hello ! Your are not Smith";// wil be displayed only if condition is false
}
?>
$myname = "Smith" ;
if ( $myname == "Smith" ) {
echo "hello ! Your are Smith"; // wil be displayed only if condition is true
} else {
echo "hello ! Your are not Smith";// wil be displayed only if condition is false
}
?>
<?php
$myname = "Smith" ;
if ( $myname == "Smith" )
echo "hello ! Your are Smith"; // wil be displayed only if condition is true
else
echo "hello ! Your are not Smith";// wil be displayed only if condition is false
?>
$myname = "Smith" ;
if ( $myname == "Smith" )
echo "hello ! Your are Smith"; // wil be displayed only if condition is true
else
echo "hello ! Your are not Smith";// wil be displayed only if condition is false
?>
PHP Code:
<?php
$myname = "Smith" ;
if ( $myname == "Smith" )
{
echo "hello ! Your are Smith"; // wil be displayed only if condition is true
echo "You are wellcome";
} else
echo "hello ! Your are not Smith";// wil be displayed only if condition is false
?>
$myname = "Smith" ;
if ( $myname == "Smith" )
{
echo "hello ! Your are Smith"; // wil be displayed only if condition is true
echo "You are wellcome";
} else
echo "hello ! Your are not Smith";// wil be displayed only if condition is false
?>