- abs: documentation ( source)
- ceil: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
for($i = 1; $i < 10; $i++)
{
$today = strtotime("+$i days");
$quote_for = strtotime('+1 Weekday',strtotime("+$i days"));
$diff = ceil(($quote_for - $today)/86400); // difference in days
echo "On " . date('l \t\h\e jS',$today) .
" the shipping quote will be for " . date('l \t\h\e jS', $quote_for) .
" which is " . abs($diff) . " days " . ($diff <0?"before":"after") . " today. " .
date('Y-m-d',$today) . " - " . date('Y-m-d',$quote_for) . "\n";
}