Welcome Guest, Not a member yet? Register   Sign In
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.




Theme © iAndrew 2016 - Forum software by © MyBB