Home  >  Article  >  Backend Development  >  for循环如何重新返回最开始处重新循环啊

for循环如何重新返回最开始处重新循环啊

WBOY
WBOYOriginal
2016-06-13 11:15:194565browse

for循环怎么重新返回最开始处重新循环啊?
for(i=0;iif(i==7){
$a=123;// 到这我想重新开始循环 且下次这里不在执行
}


}


------解决方案--------------------
从新再 给 $i  赋值为0 

不执行那里可以 设个标志位去判断
------解决方案--------------------
for(i=0;i  if($a==123){
    continue;
  }
  if(i==7){
    $a=123;// 到这我想重新开始循环 且下次这里不在执行
    continue;
  }
}
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