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;
    }