053-switch branch structure

? < PHP
     $ Week =. 3;             // define and initialize variables weeks 
    Switch ( $ Week ) {
         Case 0:             // variable to zero 
            echo 'Sunday. ' ;
             BREAK ;
         Case 1:             // variable is 1 
            echo ' Monday. ' ;
         Case 2:             // variables is two 
            echo ' Tuesday. ' ;
             BREAK ;
         Case 3:             // variable is three 
            echo ' Wednesday. ' ;
            BREAK ;
         Case 4:             // variable is four 
            echo 'Thursday. ' ;
             BREAK ;
         Case 5;             // variables case 5 
            echo ' Friday. ' ;
             BREAK ;
         default :         // variables for all cases other than the above Case 
            echo ' Saturday. ' ; 
    }
 >?

 

Guess you like

Origin www.cnblogs.com/tianpan2019/p/10994971.html