I'm creating an article listing system, and just like every blog/news site out there I would like to create an archive by month/year.
I've got the starting month (##) and starting year (####) (and of course I know the current month (##) and current year(####)), I just can't figure out how to loop out the months in between. I know someone out there has to know how to do this...
Looping through months
Moderator: General Moderators
Re: Looping through months
Code: Select all
for( $offset = 1; $offset <= 12; $offset++ )
{
$current_month++;
if( $current_month == 13 )
{
$current_month=1;
$curent_year++;
}
}
Re: Looping through months
Where does the data come from? From DB?
What do you mean by "create an archive" exaclty?
What do you mean by "create an archive" exaclty?
There are 10 types of people in this world, those who understand binary and those who don't