date_range()

date_range([$unix_start = ''[, $mixed = ''[, $is_unix = TRUE[, $format = 'Y-m-d']]]])

Parameters:
  • $unix_start (int) – UNIX timestamp of the range start date
  • $mixed (int) – UNIX timestamp of the range end date or interval in days
  • $is_unix (bool) – set to FALSE if $mixed is not a timestamp
  • $format (string) – Output date format, same as in date()
Returns:

An array of dates

Return type:

array

Returns a list of dates within a specified period.

Example:

$range = date_range('2012-01-01', '2012-01-15');
echo "First 15 days of 2012:";
foreach ($range as $date)
{
        echo $date."\n";
}
doc_CodeIgniter
2016-10-15 16:32:14
Comments
Leave a Comment

Please login to continue.