Home >php教程 >php手册 >php语言中switch的用法

php语言中switch的用法

WBOY
WBOYOriginal
2016-06-13 09:29:041332browse

php语言中switch的用法

   php语言中switch的用法介绍:

  

  $czc="reg";

  switch($czc){

  case ’reg’://注册

  echo "注册的代码";

  break;//如果注释掉此句,将执行下在的代码,否则终止

  case ’logout’://退出

  echo "退出的代码";

  break;

  default://此代码 除了reg,logout外其它的都是执行以下面的代码

  include ’user/info.php’;

  break;

  }

  /*此代码执行的结果显示:

  注册的代码

  */

  ?>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn