Skip to content

Instantly share code, notes, and snippets.

@muhfaris
Last active April 18, 2017 00:51
Show Gist options
  • Save muhfaris/b5b4a9de633ee97f4033b41ca8e7d7c2 to your computer and use it in GitHub Desktop.
Save muhfaris/b5b4a9de633ee97f4033b41ca8e7d7c2 to your computer and use it in GitHub Desktop.
Get all of sunday
<?php
$start = strtotime("now");
$end = strtotime("last day of a month");
$getMonday= array();
$datelistMonday="";
$Monday= strtotime("Sunday", $start);
while($Monday <= $end) {
$getMonday[] .=',"'.date("Y-m-d",$Monday).'"';
$Monday= strtotime("+1 weeks", $Monday);
}
print_r($getMonday[]);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment