I'm trying to create a function where I pass in a minimum and maximum timestamp and select one of 6 options:

Options:
(1) day
(2) month
(3) year
(4) hour
(5) minute
(6) month and year

The result will be an array returned with just the day, month, year, hour, minute or month and year.

Month and year will be in the format "February, 2012" etc.

function get_date_time($option, $min, $max) {

///etc

}

// returns an array of 4 - 15
echo get_date_time(1, 954806400, 955756800); // 4th April 2000 and 15th April 2000

//returns an array of 1 - 30 (because only 30 days in April)
echo get_date_time(1, 954806400, 957916800); // 4th April 2000 and 10th May 2000

//returns an array of 1 - 31 (now allows 31 as 31 days in May)
echo get_date_time(1, 954806400, 961459200); // 4th April 2000 and 20th June 2000