Home  >  Article  >  Backend Development  >  php break 二

php break 二

WBOY
WBOYOriginal
2016-06-13 13:13:451527browse

php break 2;

$i = 0;
while (++$i) {
    switch ($i) {
    case 1:
        # 只跳出switch循环,break 1 的意思是跳出一重循环
        break 1;  
    case 2:
        # 跳出switch和while循环,break 2 的意思是跳出二重循环
        break 2;  
    default:
        break;
    }
}
Statement:
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