switch command for string value : Switch : Language Basics PHP Source Code


PHP Source Code » Language Basics » Switch »

 

switch command for string value



 <?php
  $choice = "Rock";
  switch ($choice){
     case "Pop":
         print "Pop not Rock";
         break;
     case "Rap":
         print "Rap and not Rock";
         break;
     case "Jazz":
         print "Jazz not Rock";
         break;
     case "Rock":
         print "Rock music";
         break;
  }
  ?>

           
       



HTML code for linking to this page:

    PHP Function Reference -> Users Code Examples / Notes - > Switch:
  • switch
Follow Navioo On Twitter

PHP Source Code

 Navioo Language Basics
» Switch