Tuesday, 20 March 2012

switch case

<html>
<body>
<?php
$x=3;

switch ($x)
{
case 1:
  echo "Number 1";
  break;
case 2:
  echo "Number 2";
  break;
case 3:
  echo "Number 3";
  break;
default:
  echo "No number between 1 and 3";
}
?>
</body>
</html>

output
Number 3

No comments:

Post a Comment