Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $period = 5;
- function ex($period)
- {
- $daysInMonth = date('t');
- $daysOfEx = [$daysInMonth];
- for($i = $daysInMonth - 1; $i > 0; $i --) {
- if($i % $period == 0 && $daysInMonth - $i >= $period) {
- $daysOfEx[] = $i;
- }
- }
- return $daysOfEx;
- }
- print_r(ex(5));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement