Skip to content

Instantly share code, notes, and snippets.

@hihats
Last active December 26, 2015 22:59
Show Gist options
  • Select an option

  • Save hihats/7227106 to your computer and use it in GitHub Desktop.

Select an option

Save hihats/7227106 to your computer and use it in GitHub Desktop.
Get next weekday(not holiday)
<?php
inclulde isHoliday.php
function getNextWeekday($target=NULL){
if($target){
$next_weekday = date('Y-m-d', strtotime($target));
}else{
$next_weekday = date('Y-m-d');
}
$is_holiday = TRUE;
while($is_holiday){
$is_holiday = isHoliday($next_weekday);
$next_weekday = date('Y-m-d', strtotime('+1 day', strtotime($next_weekday)));
}
return $next_weekday;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment