I have a loop within PHP (codeigniter framework) that uses an array ($products) to display product data. Not all the products in the array have values.
Is there anyway that I can hide the call to display those values if they do not exist within the array.
Full code for the loop below;
<!-- Product item row -->
<?php foreach($products as $product): ?>
<div class="row product-list-row">
<div class="col-md-2 item-img-container" align="center">
<img class="img-responsive item-img" src="http://products.supercompare.co.uk<?= $product['logo']?>" alt="<?= $product['name']?> - supacompare.co.uk" width="190px" height="120px" /><br />
<!--<a role="button" data-toggle="collapse" href="#item-terms" aria-expanded="false" aria-controls="item-terms">LESS DETAILS ▼</a>-->
</div>
<div class="col-md-7 item-text">
<h3><?= $product['name']?></h3>
<div class="content-wrapper">
<div class="content-1">
<p><strong><?= $product['custom_fields'][0]['field']?></strong>
<br /><?= $product['custom_fields'][0]['value']?></p>
</div>
<div class="content-2">
<p><strong><?= $product['custom_fields'][1]['field']?></strong>
<br /><?= $product['custom_fields'][1]['value']?></p>
</div>
<div class="content-3">
<p><strong><?= $product['custom_fields'][2]['field']?></strong>
<br /><?= $product['custom_fields'][2]['value']?></p>
</div>
<div class="content-4">
<p><strong><?= $product['custom_fields'][3]['field']?></strong>
<br /><?= $product['custom_fields'][3]['value']?></p>
</div>
<div class="content-bottom">
<p><?= $product['footer_text']?></p>
</div>
</div>
</div>
<div class="col-cta"><a class="apply-btn" href="<?= $product['tracking_link']?>" target="_blank">SEE DEAL »</a></div>
<!--<div class="clearfix"></div>-->
<!--<div id="item-terms" class="col-md-12 footer-terms" style="background-color:#B4B4B4; padding:10px; margin-top:10px;"><?= $product['footer_text']?></div>-->
</div>
<?php endforeach; ?>
emptyorissetto check if the value is empty or thekeyis set