public function dateArray($begin, $end, $format = 'Y-m-d')
    {
        $begin = new \DateTime($begin);
        $end = new \DateTime($end);
        $end = $end->modify('+1 day');

        $interval = new \DateInterval('P1D');
        $daterange = new \DatePeriod($begin, $interval, $end);

        $dateArray = array();
        foreach ($daterange as $date) {
            $dateArray[] = $date->format($format);
        }

        return $dateArray;
    }
public function dateArray($begin, $end, $format = 'Y-m-d')
    {
        $begin = new \DateTime($begin);
        $end = new \DateTime($end);
        $end = $end->modify('+1 day');

        $interval = new \DateInterval('P1D');
        $daterange = new \DatePeriod($begin, $interval, $end);

        $dateArray = array();
        foreach ($daterange as $date) {
            $dateArray[] = $date->format($format);
        }

        return $dateArray;
    }
public function dateArray ( $ begin , $ end , $ format = 'Y-m-d' ) { $ begin = new \ DateTime ( $ begin ) ; $ end = new \ DateTime ( $ end ) ; $ end = $ end -> modify ( '+1 day' ) ; $ interval = new \ DateInterval ( 'P1D' ) ; $ daterange = new \ DatePeriod ( $ begin , $ interval , $ end ) ; $ dateArray = array ( ) ; foreach ( $ daterange as $ date ) { $ dateArray [ ] = $ date -> format ( $ format ) ; } return $ dateArray ; }
Generate date array
@param  Date $begin Date start
@param  Date $end   Date end
@return array       array date
Generate date array