title: Hide div based on time - PHP
body: <p>I'm using Magento, and am trying to hide a div based on time using PHP. I found this bit of code</p>
  
  <pre><code>&lt;?php date_default_timezone_set('America/New_York');
  $currentHour = date("H");
  $openTime = 8;
  $closeTime = 9;
  if ($currentHour &gt;= $openTime &amp;&amp; $currentTime &lt; $closeTime){
  $css = 'display:block;';
  }else{
  $css = 'display:none;';
  }
  
  echo '&lt;style type="text/css"&gt;.timeBasedLink {'.$css.'}&lt;/style&gt;'; ?&gt;
  </code></pre>
  
  <p>And then when I view my websites source (even though right now it is after 9 am, which I've set the time to in PHP just so I could test if it hides, we actually close at 6), it shows up in the header as</p>
  
  <pre><code>&lt;style type="text/css"&gt;.timeBasedLink {display:block;}&lt;/style&gt;
  </code></pre>
  
  <p>no matter what time it is it always shows up as display: block. Might be an error in my code, as I'm still learning PHP.</p>
  
  <p>EDIT: Also does anyone know how to change this to hide it all day Saturday and Sunday? =/</p>