Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Use the 'default' case

Mon Oct 27, 2008 5:56 pm

Code:
<?
    $nIndex
= 17;
    switch (
$nIndex )
    {
        case
0:
            print(
"zero<br>" );
            break;
        case
1:
            print(
"one<br>" );
            break;
        case
2:
            print(
"two<br>" );
            break;
        default:
            print(
"neither zero, one nor two<br>" );
            break;
    }
?>




Post a reply
  Related Posts  to : Use the 'default' case
 Change letters to upper case by default     -  
 Convert To Upper Case in C++     -  
 convert string to lower case     -  
 restrictions on the values of each case of a switch     -  
 Change String to Upper case     -  
 Assign default property value     -  
 Function with default parameters     -  
 String type default value     -  
 Default Initial Values in java     -  
 Default Expire time for Session JAVA     -  

Topic Tags

PHP Basics