是否有可能从开关断开然后继续循环?
原文链接:https://www.f2er.com/php/135934.html例如:
$numbers= array(1,2,3,4,5,6,7,8,9,0); $letters = array('a','b','c','d','e','f','g'); foreach($letters as $letter) { foreach($numbers as $number) { switch($letter) { case 'd': // So here I want to 'break;' out of the switch,'break;' out of the // $numbers loop,and then 'continue;' in the $letters loop. break; } } // Stuff that should be done if the 'letter' is not 'd'. }
可以这样做,语法是什么?