Friday, 19 April 2013

PHP Switch


Switch function basically the same as If and Else, equally be used to distinguish a condition.

Switch PHP.
To distinguish the situation of many of the conditions.

EXAMPLE:
<? php
switch ($ x) {
case 1:
echo 'No 1';
break;

case 2:
echo 'No 2';
break;

case 3:
echo 'No 3';
break;

default:
echo "No number between 1 to 3 ';
}
?>

No comments:

Post a Comment