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
case?
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 语句中的另一种情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!