function getSundays($y, $m) {
return new DatePeriod(
new DateTime("first sunday of $y-$m"),
DateInterval::createFromDateString('next sunday'),
new DateTime("last day of $y-$m")
);
}
// Usage:
foreach (getSundays(2021, 03) as $sundays) {
echo $sundays->format("l, Y-m-d
");
}
Code Example |
---|
Php :: new line php |
Php :: default index page for laravel in cpanel |
Php :: console php |
Php :: carbon to mysql datetime |
Php :: array push foreach php |
Php :: orderby text values eliquent laravel |
Php :: woocommerce get user id by email |
Php :: php convert hex to rgba |
Php :: how to reverse fetch assoc in php |
Php :: php odd or even |
Php :: datediff in hour query builder laravel |
Php :: change php version in vagrant |
Php :: php iterate array keys |
Php :: composer clear cache |
Php :: laravel return data from model to another controller |
Php :: laravel add utility class |
Php :: create user with tinker php laravel |
Php :: php current page url |
Php :: how to create shortcode |
Php :: php number positive |
Php :: read global laravel request() |
Php :: pdo bindparam string |
Php :: is home page if wordpress |
Php :: toarray php |
Php :: nl2br php |
Php :: strpos in php |
Php :: linux set default php |
Php :: Fatal error: Cannot redeclare |
Php :: laravel model create array |
Php :: laravel route group name |