跳转到PHP switch语句中的另一种情况 [英] Jump to another case in PHP switch statement
本文介绍了跳转到PHP switch语句中的另一种情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
说我有这样的东西:
switch ($_GET['func']) {
case 'foo':
dobar();
break;
case 'orange':
if ($_GET['aubergine'] == 'catdog') {
// **DO DEFAULT OPTION**
} else {
dosomethingElse();
}
break;
default:
doDefault();
}
如何从case 'orange'
中的标记点跳到default
案例?
How can I jump to the default
case from the marked spot in case 'orange'
?
推荐答案
尝试:
switch($_GET['func']) {
case 'foo':
dobar();
break;
case 'orange':
if($_GET['aubergine'] != 'catdog') {
dosomethingElse();
break;
}
default:
doDefault();
}
这篇关于跳转到PHP switch语句中的另一种情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文