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

php语言中switch的用法

WBOY
Release: 2016-06-13 09:29:04
Original
1342 people have browsed it

php语言中switch的用法

   php语言中switch的用法介绍:

  

  $czc="reg";

  switch($czc){

  case ’reg’://注册

  echo "注册的代码";

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

  case ’logout’://退出

  echo "退出的代码";

  break;

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

  include ’user/info.php’;

  break;

  }

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

  注册的代码

  */

  ?>

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template