Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Weekend Dates in php

Tags:

I am working on a php application which requires that I extract the dates of the weekends between two dates and then insert them as single records in the mysql database.

I was thinking if there was a simpler way of doing it, rather than going through the loop between start date and end date and for each date checking if date('l', strtotime($date)) returns "Saturday" or "Sunday"

Thanks for your time

Sunil