foreach($xxx as $x){if($a == 2){continue;//如果符合这个要求,本次循环内的以下语句不再执行 开始下一次循环}mysql_query("xxxxxxxxxxxxxxxxxxxxxxxxxxxxx");}