How to write switch in PHP
Switch is used to select one of many blocks in the code.User will select block accordingly and that particular block will be executed.
//To print Subject names using switch in PHP
echo "You selected Maths";
echo "You selected English!";
echo "You selected Science!";
echo "You did not select any subject!!!";
/*Output of the above program is:
You selected Science!