fuel/fuel/core/classes/date.php
public static function range_to_array($start, $end, $interval = '+1 Day')
	{
		$start = ( ! $start instanceof Date) ? static::forge($start) : $start;
		$end   = ( ! $end instanceof Date) ? static::forge($end) : $end;

		is_int($interval) or $interval = strtotime($interval, $start->get_timestamp()) - $start->get_timestamp();

		if ($interval <= 0)
		{
			throw new \UnexpectedValueException('Input was not recognized by pattern.');
		}

		$range   = array();
		$current = $start;

		while ($current->get_timestamp() <= $end->get_timestamp())
		{
			$range[] = $current;
			$current = static::forge($current->get_timestamp() + $interval);
		}

		return $range;
	}
public static function range_to_array($start, $end, $interval = '+1 Day')
	{
		$start = ( ! $start instanceof Date) ? static::forge($start) : $start;
		$end   = ( ! $end instanceof Date) ? static::forge($end) : $end;

		is_int($interval) or $interval = strtotime($interval, $start->get_timestamp()) - $start->get_timestamp();

		if ($interval <= 0)
		{
			throw new \UnexpectedValueException('Input was not recognized by pattern.');
		}

		$range   = array();
		$current = $start;

		while ($current->get_timestamp() <= $end->get_timestamp())
		{
			$range[] = $current;
			$current = static::forge($current->get_timestamp() + $interval);
		}

		return $range;
	}
public static function range_to_array ( $ start , $ end , $ interval = '+1 Day' ) { $ start = ( ! $ start instanceof Date ) ? static :: forge ( $ start ) : $ start ; $ end = ( ! $ end instanceof Date ) ? static :: forge ( $ end ) : $ end ; is_int ( $ interval ) or $ interval = strtotime ( $ interval , $ start -> get_timestamp ( ) ) - $ start -> get_timestamp ( ) ; if ( $ interval <= 0 ) { throw new \ UnexpectedValueException ( 'Input was not recognized by pattern.' ) ; } $ range = array ( ) ; $ current = $ start ; while ( $ current -> get_timestamp ( ) <= $ end -> get_timestamp ( ) ) { $ range [ ] = $ current ; $ current = static :: forge ( $ current -> get_timestamp ( ) + $ interval ) ; } return $ range ; }
Fetches an array of Date objects per interval within a range

@param   int|Date    start of the range
@param   int|Date    end of the range
@param   int|string  Length of the interval in seconds or valid strtotime time difference
@return   array      array of Date objects
Fetches an array of Date objects per interval within a range