Skip to content

Instantly share code, notes, and snippets.

@Kcko
Last active December 26, 2015 07:39
Show Gist options
  • Save Kcko/7116966 to your computer and use it in GitHub Desktop.
Save Kcko/7116966 to your computer and use it in GitHub Desktop.
Date range - vygenerování datum. rozmezí
<?php
function dateRange( $first, $last, $step = '+1 day', $format = 'Y/m/d' ) {
$dates = array();
$current = strtotime( $first );
$last = strtotime( $last );
while( $current <= $last ) {
$dates[] = date( $format, $current );
$current = strtotime( $step, $current );
}
return $dates;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment