Sunday, May 31, 2009

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:

  © Blogger template 'Minimalist G' by Ourblogtemplates.com 2008

Back to TOP