Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如果条件反向工作,则PHP html逻辑错误_Php_Html - Fatal编程技术网

如果条件反向工作,则PHP html逻辑错误

如果条件反向工作,则PHP html逻辑错误,php,html,Php,Html,我有一个表单,其中使用了一对嵌套的foreach循环。我不明白为什么continue语句在条件为false而不是true时执行:下面是我正在使用的代码 <?php $array =[9,10,11,12,13,14,15,16,17,18,19,20,21] ; $i = 0;?> <?php foreach ($reservations as $reservation): ?> <table class="tabsize1" style ="margi

我有一个表单,其中使用了一对嵌套的foreach循环。我不明白为什么continue语句在条件为false而不是true时执行:下面是我正在使用的代码

<?php $array =[9,10,11,12,13,14,15,16,17,18,19,20,21] ; $i = 0;?> 
<?php foreach ($reservations as $reservation):  ?>

   <table class="tabsize1" style ="margin-top:0%;margin-bottom:0%;">
      <tbody>    
         <tr >
             <td class="nextsail"><?=$reservation["date"]     ?></td>
             <td class="nextsail"><?=$reservation["boat"]     ?></td>          
             <td class="nextsail"><?=$reservation["start_res"]?></td>   
             <td class="nextsail"><?=$reservation["end_res"]  ?></td> 
        </tr>    
     </tbody>
  </table>


  <?php  if($weather[$i]['cnt'] == 24) continue ; ?>  <!-- this works if i use != but $weather[$i]['cnt'] = 24  --> 

 <table >
   <tbody>    
      <tr >      
         <?php  foreach ($array as $value): ?>  
           <td> <?= $weather[$i][$value]['HOUR']?></td> 
         <?php endforeach ?> 
      </tr>
   </tbody>
 </table>   

 <?php $i++; ?>       

<?php endforeach ?>   

你失踪了;在endforeach之后

我想你不明白continue做什么了。这意味着跳到循环的下一个迭代,而不是继续循环的其余部分。谢谢,我读了3遍手册,但它没有理解。