- Calculate the number of days between the two dates (including the start and end dates).
$allDays = (strtotime($endDate) - strtotime($startDate)) / (60 * 60 * 24) + 1; - Determine the day of the week for both the start date and the end date (numerical - 1 through 7).
$startDOW = date('w', strtotime($startDate)) + 1; - Calculate the number of weekdays found in full weeks
$fullWeekdays = (floor($allDays / 7) * 5); - And the tricky bit - calculate the remaining weekdays
$modulusWeekdays = $endDOW - $startDOW + 1 + ($startDOW == 1 ? -1 : 0) + ($endDOW == 7 ? -1 : 0);
if ($modulusWeekdays < 0) $modulusWeekdays += 5; - Add the number of weekdays in full weeks to the remainder of weekdays and there's the answer. The number of weekdays that occur between any two dates.
UPDATE:
Here's a tool I've created that you can use to find the number of weekdays or weekends in a given time period: http://gabegrayum.com/tools/datecalc/