0

I know this question has many answers on the site, but I need a different thing.

I have an array of dates of the current month, now I want to get the days that are Saturday and Sunday.

$dates = array ('2019-03-01', '2019-03-02', '2019-03-03', '2019-03-04', ...);

I found a function that checks TODAY, but I want it to check any date with this format: YYYY-MM-DD

if(date('D') == 'Sat' || date('D') == 'Sun') { 
  echo "Today is Saturday or Sunday.";
} else {
  echo "Today is not Saturday or Sunday.";
}
medk
  • 9,233
  • 18
  • 57
  • 79
  • 1
    What is the second argument of date? What is the usage of strtotime? Answer those two questions and you got your answer – Andreas Mar 19 '19 at 14:58
  • 1
    And https://stackoverflow.com/questions/12835133/how-to-find-the-date-of-a-day-of-the-week-from-a-date-using-php – Andreas Mar 19 '19 at 14:59

0 Answers0