Use the 'default' case
|
<? $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; } ?>
|
|
|
|
|
HTML code for linking to this page:
Related in same category :
-
-
-
PHP Function Reference -> Users Code Examples / Notes - > Switch:
- switch
|