SWITCH Conditional
This is a sample SWITCH conditional for the same function as that of the IF-ELSE script.
<?php
switch ($_POST[number]) {
case 0:
echo "The number you entered is <b>Zero</b>";
break;
case ($_POST >0):
echo "The number you entered is a <b>Positive</b> integer!";
break;
case ($_POST <0):
echo "The number you entered is a <b>Negative</b> integer!";
break;
}
?>

0 comments:
Post a Comment