how to limit this loop ..just thee loops..thanks for helping
<?php foreach($section['Article'] as $article) : ?> <tr> <td> <?php if ($article['status'] == 1) { echo $article['title']; } ?> </td> <td> <?php if($article['status']== 1) { echo ' '.$html->link('View', '/articles/view/'.$article['id']); } ?> </td> </tr> <?php endforeach; ?>
The nesting operator: %:% I call this the nesting operator because it is used to create nested foreach loops. Like the %do% and %dopar% operators, it is a binary operator, but it operates on two foreach objects. It also returns a foreach object, which is essentially a special merger of its operands.
break ends execution of the current for , foreach , while , do-while or switch structure.
The forloop is faster than the foreach loop if the array must only be accessed once per iteration.
Slice the array.
foreach(array_slice($section['Article'], 0, 3) as $article ):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With