跳转到 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();
}
相关文章