<html> <head> <title>Switch Statement</title> </head> <body> <?php $num = 2; switch($num) { case 1 : echo("This is case 1 code"); break; case 2 : echo("This is case 2 code"); break; case 3 : echo("This is case 3 code"); break; default : echo("This is default code"); } ?> </body> </html>