Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $from = new DateTime('2018-01-11');
- $to = new DateTime('2018-04-20');
- $period = new DatePeriod($from, new DateInterval('P1D'), $to);
- $arrayOfDates = array_map(
- function($item){
- return array(
- strtr(
- $item->format('w'),
- array("вс", "пн","вт","ср","чт","пт","сб")
- )
- ,
- $item->format('Y-m-d')
- );
- },
- iterator_to_array($period)
- );
- print_r($arrayOfDates);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement