PHP Function that Returns the Date for a Specific Day Between Two Given Dates

Here’s a PHP function that returns the date for a specific day between two given dates. The function takes two dates formatted as YYYY-MM-DD and creates an inclusive array of the dates between the from and to dates. function getDateForSpecificDayBetweenDates($startDate, $endDate, $weekdayNumber) { $startDate = strtotime($startDate); $endDate = strtotime($endDate); $dateArr = array(); do { if(date(“w”, […]

Continue reading