title: PHP Date Open and Close Script
body: <p>I have a task to create a script using php to display open and closed during the correct times. So far I have the time working correcty and this would be fine if the business was open during this time for 7 days a week. However the scenerio for the project is the business is open mon-fri 7:00am - 5:30 pm then open saturdays 7:00am to 1:00pm and closed sundays. I thought I could use a date function w since is displays 0-6 and call if</p>
  
  <pre><code>if($date &gt;= 0 &amp;&amp; $date &lt; 6)
  </code></pre>
  
  <p>but that didn't work. Here is the code I have so far</p>
  
  <pre><code>&lt;?php
  
  date_default_timezone_set('America/Chicago');
  $open = "700";
  $close = "1730";
  $time = date('Gi');
  $day = date('w');
  
  if ($time &gt;= $open &amp;&amp; $time &lt;= $close) {
      echo "We are Open";
  } else {
      echo "We are closed";
  }
  
  ?&gt;
  </code></pre>