PHP – switch Statements

switch Statements allow you to allow events to happen based on specific values for variables.

<?php

$region = 2;

switch($region){
	case 1:
		print "ONE day shipping";
		break;
	case 2:
		print "TWO day shipping";
		break;
	case 3:
		print "THREE day shipping";
		break;
	default:
		print "WE DO NOT SHIP TO YOU";
		print "<br>";
		print "Please contact Customer Support";
		break;
}
?>

Be the first to comment

Leave a Reply