[eluser]georgerobbo[/eluser]
Hello,
I'm trying to use an IF statement to hide a <div> if a certain variable is blank. I really experimenting with trial and error.
This is my view.
Code:
<div id="sidebar_bod">
<div class="container">
<?php
foreach($notice as $item)
if($item['Status'] == 'Urgent')
{
?>
<div id="latest_notice">
<h2>Urgent Notices</h2>
<?php foreach($notice as $item): ?>
<h3><?php echo $item['Topic']; ?></h3>
<h4><?php echo $item['Date']; ?></h4>
<p><?php echo $item['Notice']; ?></p>
<?php endforeach; ?>
</div>
<?php
}
else
{
}
?>
</div>
</div>