这可能非常微不足道,但我一直无法弄清楚。PHP继续内部功能
这工作:
function MyFunction(){
//Do stuff
}
foreach($x as $y){
MyFunction();
if($foo === 'bar'){continue;}
//Do stuff
echo $output . '<br>';
}
但这并不:
function MyFunction(){
//Do stuff
if($foo === 'bar'){continue;}
}
foreach($x as $y){
MyFunction();
//Do stuff
echo $output . '<br>';
}
国债收益率只有1 $输出,然后:
Fatal error: Cannot break/continue 1 level
任何想法,我在做什么错误?
+1,因为你增加了一个链接;) – 2011-05-31 06:24:33
是的,这是正确的,我会用'返回;'如果你想停止执行功能。 – 2011-05-31 06:57:13