I am using this to find the total number of days in a month dynamically
$count = cal_days_in_month(CAL_GREGORIAN, $_POST['PayMonth'], $_POST['PayYear']);
But How can i calculate the number of days in that particular month leaving Saturday and Sunday ?
Here's a function from the user comments on the date() function page in the PHP manual. It's an improvement of an earlier function in the comments that adds support for leap years.
Enter the starting and ending dates, along with an array of any holidays that might be in between, and it returns the working days as an integer:
Reference : link1 and link2
This is what I use to calculate the number of days without weekend in a month: