Skip to main content

Posts

Showing posts from April, 2010

Get all dates between two dates

This is a PHP function to get all the dates between two dates. The function will return an array including both the starting and ending date. The returned date format will be Year-month-date(YYYY-MM-DD) just as MySQL standard date format. The function accepts two parameters 1. The start date. 2. The end date. The input date format must acceptable by PHP strtotime function function datesBetween($start_date=null,$end_date=null) { $dates=array(); $dates[0]=date('Y-m-d',strtotime($start_date)); $secs=strtotime($start_date); $i=1; while($secs