I'm trying to limit the amount of results that show in my foreach, I've got this so far:
<?php $facilitiescounter = 0; ?>
<?php foreach ($facilities as $data) {
if (++$facilitiescounter == 7) break;
echo '<div class="checkmark-33"><div class="fa-stack fa-1x checkmark-icon"><i class="fa fa-circle fa-stack-2x icon-background"></i><i class="fa fa-check fa-stack-1x icon-text"></i></div><div class="checkmark-inner">'. $data->Name .'</div></div>'; }?>
<a class="read-more-show hide" href="#">Show More</a> <span class="read-more-content">Show all other results from array <a class="read-more-hide hide" href="#">Show Less</a></span>
I have managed to limit it to the first 6 results, is it possible to do another foreach to get all the other results excluding the first six?
Or is there a better way of doing this? Thanks!