CodeIgniter Forums
ISSET statement - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: ISSET statement (/showthread.php?tid=22348)



ISSET statement - El Forum - 09-06-2009

[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">
                                &lt;?php        
                                foreach($notice as $item)
                                if($item['Status'] == 'Urgent')
                                {
                                ?&gt;
                                        <div id="latest_notice">
                                        <h2>Urgent Notices</h2>
                                        &lt;?php foreach($notice as $item): ?&gt;
                                        <h3>&lt;?php echo $item['Topic']; ?&gt;</h3>
                                        <h4>&lt;?php echo $item['Date']; ?&gt;</h4>
                                        <p>&lt;?php echo $item['Notice']; ?&gt;</p>
                                        &lt;?php endforeach; ?&gt;
                                </div>
                                &lt;?php
                                }
                                else
                                {
                                }
                                ?&gt;
                            </div>
                        </div>



ISSET statement - El Forum - 09-06-2009

[eluser]georgerobbo[/eluser]
^

Ignore. Solved.