• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ISSET statement

#1
[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>

#2
[eluser]georgerobbo[/eluser]
^

Ignore. Solved.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.