简体   繁体   中英

PHP: Get date by day name in given date range

I have two date range between 2015-05-05 TO 2015-06-05(Ymd) and also I have day array like

Array ( [0] => Sun [1] => Mon [2] => Tue )

So I want to return date between above date range of given day name only.

Your suggestion is valuable.

Thanks.

To get the value between two dates, you can use DateTime::diff .

To return only day's name, you can use DateTime::format passing the parameter "l".

Others questions like that, you can find the answer on the doc. It's your friend! =P

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM