Hello. There is an array in the $myMessage['viewed'] array in it for the elements that have the ['status'] key, which interests me. Everything works ok, only if I have for example 3 messages with ['status'] == 0 gives me NEW NEW NEW
The task of each item to check the status, and if at least one of them has zero, then you need to output one NEW. How can this be done without interfering with SQL?
<?php foreach ($myMessage['viewed'] as $item) { ?> <?php if( $item['status'] == 0) { ?> <?php $checkByStatus = true; ?> <?php if( $checkByStatus == true) { ?> chek = <?php echo $checkByStatus; ?> <span style="color: red;">NEW</span> <?php }?> <?php } ?> <?php }?>