The examples are as follows:
<!doctype html> <meta http-equiv="content-type" content="text/html" charset="utf-8"/> switch语句,switch语句用于根据多个不同条件执行不同动作。<br/> 如果你希望有选择地执行若干代码块之一,还请使用switch语句。 <br/> 语法结构如下: <pre class="brush:php;toolbar:false"> switch(n) { case label1: 如n=label1,此处代码将执行; break; case label2: 如n=label2,此处代码将执行; break; case label3: 如n=label3,此处代码将执行; break; default: 如果n既不等于label1页不等于label2,此处代码将执行; }
The above is the entire content of the example code that the editor brought to you for using the switch statement to make multiple selections. I hope Please support the PHP Chinese website~
For more relevant articles on example codes that use switch statements to perform multiple selections, please pay attention to the PHP Chinese website!