PHP,继续;on foreach(){ foreach(){
有没有办法继续在外部前方,以防内部前方遇到一些陈述?
示例中
foreach($c as $v)
{
foreach($v as $j)
{
if($j = 1)
{
continue; // But not the internal foreach. the external;
}
}
}
有没有办法继续在外部前方,以防内部前方遇到一些陈述?
示例中
foreach($c as $v)
{
foreach($v as $j)
{
if($j = 1)
{
continue; // But not the internal foreach. the external;
}
}
}
试试这个:根据手册:continue 2;
continue accepts an optional numeric argument which tells it how many levels of enclosing loops it should skip to the end of.