I am writing a PHP script where the inputs are:
From date
To date
I then want to take that date range and create an array of some sort that has
you can try this
function makeDateRange($from,$to,$pattern='m-d-y')
{
$day = date( $pattern , $from );
$to = date( $pattern , $to );
$parseDate = date_parse($from);
while( $day <= $to ) {
$day = mktime(0,0,0,$parseDate["month"],$parseDate["day"]+1,$parseDate["year"]);
$dateArray[] = date($pattern , $day);
}
return $dateArray;
}
// here make array $keys = makeDateRange("12-01-11","12-02-11");
//here make above array as key in $a array $a = array_fill_keys($keys, 'none'); print_r($a);