/ Published in: PHP
Obtener las fechas que hay entre dos fechas dadas. No es la diferencia de días o similares, sino las fechas en sí.
Expand |
Embed | Plain Text
/** * Returns an array with the dates between to dates given. * * @link http://us3.php.net/manual/en/function.date.php#AEN25217 * * @param mixed $startdate Timestamp or strtotime() recognizeable string * @param mixed $enddate Timestamp or strtotime() recognizeable string * @param string[optional] $format date() format string * @return mixed Array of timestamps or dates if given format */ if($startdate > $enddate){ return false; //The end date is before start date } while($startdate < $enddate){ $startdate += 86400; } return $arr; }
You need to login to post a comment.
