I am trying to get the next 3 days using php, but if the date is a holiday or a specific holiday, I would skip this date.
For example, if the date is Monday, December 23, 2013, my array('2013-12-24', '2013-12-25');
script will return my vacation dates
Monday, December 23, 2013
Thursday, December 26, 2013
Friday, December 27, 2013
Monday, December 30, 2013
This is my current code:
$arr_date = explode('-', '2013-12-23');
$counter = 0;
for ($iLoop = 0; $iLoop < 4; $iLoop++)
{
$dayOfTheWeek = date("N", mktime(0, 0, 0, $arr_date[1], $arr_date[2]+$counter, $arr_date[0]));
if ($dayOfTheWeek == 6) { $counter += 2; }
$date = date("Y-m-d", mktime(0, 0, 0, $arr_date[1], $arr_date[2]+$counter, $arr_date[0]));
echo $date;
$counter++;
}
The problem I'm facing is I'm not sure how to go at all except for vacation dates.
source
share