Help with validating date/time with PHP if statement
<p>I've been reading my way through the PHP documentation, but I've hit a wall. New to PHP here.</p>

<p>The idea of this script is pretty straightforward:
Before 10 a.m. on Mon, Tue &amp; Wed - order ships same day. After 10 a.m. on Wed - order ships Monday. All day Thursday, Friday, Saturday and Sunday - order ships Monday</p>

<p>I am trying to check the day of the week and time of day to tell the user when their order will ship. I found that when <code>$current_time = date("H");</code> for the whole 10:00 a.m. hour I get an error showing all three options:</p>

<ul>
<li>your order will ship today.</li>
<li>your order will ship tomorrow.</li>
<li>your order will ship monday.</li>
</ul>

<p>I'm sure that this is because of my poorly written if statement.</p>

<p>Then I moved on to using <code>date("H:i");</code>, but to no avail. I know that I'm probably doing something wrong with writing something like this:</p>

<pre><code>else if ($d &lt; 4 &amp;&amp; $current_time &gt;= 10:00) {
</code></pre>

<p>Source:</p>

<pre><code>&lt;?
    $current_time = date("H:i");
    $d = date("N");

    if ($d &gt; 3) {
        echo('&lt;p&gt;your order will ship monday&lt;/p&gt;');
    }
    else
        if ($d &lt; 4 &amp;&amp; $current_time &gt;= 10:00) {
            if ($d = 1 &amp;&amp; $current_time &lt;= 10:00 || $d = 2 &amp;&amp; $current_time &lt;= 10:00) {
                echo('&lt;p&gt;your order will ship today.&lt;/p&gt;');
            }

            if ($d = 1 &amp;&amp; $current_time &gt;= 10:01 || $d = 2 &amp;&amp; $current_time &gt;= 10:01) {
                echo('&lt;p&gt;your order will ship tomorrow.&lt;/p&gt;');
            }

            if ($d = 3 &amp;&amp; $current_time &lt;= 10:00) {
                echo('&lt;p&gt;your order will ship monday.&lt;/p&gt;');
            }
        }
?&gt;
</code></pre>

<p>I'm sure this could be slimmed down quite a bit. Any help is greatly appreciated.</p>
