Header AD

If and Else Statement

The if and else statements can be very helpful in controlling the power and resulting output of your scripts.You can input your site with basically unlimitited possibilities.You can diffrent massage based on different content or persone's.


EXAMPLE OF CODE

<?php
$ages=45;
if($ages=1 && $ages<=4){
echo "Infant";
}else if($ages=5 && $ages<=12){
echo "child";
}else if($ages=13 && $ages<=19){
echo "Teen";
}else if($ages=20 && $ages<=40){
echo "Youth";
}else if($ages=41 && $ages<=60){
echo "adult";
}else{
echo "Enter correct value";
}
?>

If and Else Statement If and Else Statement Reviewed by rajesh rauniyar on 4:38 PM Rating: 5

No comments

Post AD