Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function countDays($year, $month, $ignore) {
- $count = 0;
- $counter = mktime(0, 0, 0, $month, 1, $year);
- while (date("n", $counter) == $month) {
- if (in_array(date("w", $counter), $ignore) == false) {
- $count++;
- }
- $counter = strtotime("+1 day", $counter);
- }
- return $count;
- }
- echo countDays(2015, 9, array(0, 7)); // từ thứ 2->7;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement