Php Estimated Shipping Date Function - Skipping Weekends
<p>I need some help with skipping weekends properly in an estimated shipping date function.  The code I have now doesn't work correctly.  The code that is currently giving me trouble is:</p>

<pre><code>$adddays = 0;
for ($i = 0; $i&lt;$processdays; $i++) {
  $dayofweek = $startdayofweek + $i;  
  if ($dayofweek == "6") { $adddays = $adddays+2; }
  elseif ($dayofweek == "8") { $dayofweek = "1"; }

 }
</code></pre>

<p>and</p>

<pre><code>if ($dayofweekfinal=='6') { $processdays = $processdays+2;  }
else if ($dayofweekfinal=='7') { $processdays = $processdays+1;  }
</code></pre>

<p>The top part skips the weekends and the bottom part kicks the final day in the count over to a Monday if it lands on a weekend.  Seems it would work better if the code just pretended the weekend days didn't exist.  I would think that if that was done correctly, there would be no need for that second part.  I have searched all over for code to replace this but it either doesn't work or I can't get it to work with my current code.  I could really use some help.  Thank you.</p>
