<? foreach ($cases as $case) :?>
<? if (isset($case['case_status']) && ($case['case_status'] == 'Incomplete')) :?>
<div>
<div class="alert alert-error">
<?= $warning ?>
</div>
I'm trying to have that foreach print out the div only once if the condition is met. The problem is, for every case that meets the condition the div is printed.
I have tried using in_array, but I don't think I understand the syntax. Is in_array correct? Is there a better way to do this?
<?php break; ?>at the end of (but inside) theifto stop theforeach.