get array of months between 2 dates |
[eluser]new_igniter[/eluser]
Hello, Does anyone have a php function for finding the array of months values based on two dates? for example Code: function getMonths('2008-01-01','2008-05-01') {
[eluser]xwero[/eluser]
Can you define array of months? the simplest way i know would be to strtotime the dates if they are in that format and loop until the month in the future is reached.
[eluser]new_igniter[/eluser]
I actually just found and used this: http://www.dbforums.com/showthread.php?t=1617949 Thanks for your help
[eluser]xwero[/eluser]
My solution Code: function get_months($date1, $date2) Another way you could code the function is to let the chronology the dates are added control the sorting of the months, ascending or descending. |
Welcome Guest, Not a member yet? Register Sign In |