Home > Backend Development > PHP Tutorial > How to use switch in php language_PHP tutorial

How to use switch in php language_PHP tutorial

WBOY
Release: 2016-07-13 10:22:51
Original
1011 people have browsed it

How to use switch in php language

Introduction to how to use switch in php language:

$czc="reg";

switch($czc){

case ‘reg’://register

echo "Registered code";

break;//If this sentence is commented out, the following code will be executed, otherwise it will terminate

case ’logout’://Exit

echo "Exit code";

break;

Default://This code except reg and logout executes the following code

include ‘user/info.php’;

break;

 }

/*The result of executing this code is displayed:

Registration code

 */

 ?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/845128.htmlTechArticleUsage of switch in php language Introduction to the usage of switch in php language: $czc=reg; switch($czc) { case reg://Register echo registration code; break;//If you comment out this sentence, the following code will be executed...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template