I need a method for adding \"business days\" in PHP. For example, Friday 12/5 + 3 business days = Wednesday 12/10.
At a minimum I need the code to understand weekend
Today is (ORDER DATE): " . '' . date('l, F j, Y', $today) . "
";
//The numerical representation for day of week (Ex. 01 for Monday .... 07 for Sunday
$today_numerical = date("N",$today);
//leadtime_days holds the numeric value for the number of business days
$leadtime_days = $_POST["leadtime"];
//leadtime is the adjusted date for shipdate
$shipdate = time();
while ($leadtime_days > 0)
{
if ($today_numerical != 5 && $today_numerical != 6)
{
$shipdate = $shipdate + (60*60*24);
$today_numerical = date("N",$shipdate);
$leadtime_days --;
}
else
$shipdate = $shipdate + (60*60*24);
$today_numerical = date("N",$shipdate);
}
echo 'Estimated Ship date: ' . '' . date('l, F j, Y', $shipdate) . "";
?>