php

Associate
Joined
26 Jan 2006
Posts
1,502
How I can create a loop in php to start from a given date and stop to today? I want to be able to make lists of months passed. Like start the loop from

jan 06 untill today and get a list with jan 06 feb 06 ...... feb 07


I could use the unix time and do some maths, but not every month is 30 days etc to split.

Any thoughts?

thanks.
 
Last edited:
I could use the unix time and do some maths, but not every month is 30 days etc to split.

date('t') ;)

I did this in a project by using date('t', $timestamp) and mktime() (to create a date instance of the first moment of the month) to achieve this - it's simple stuff.
 
Back
Top Bottom