Stats question: Find stats from a given year to this year

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Stats question: Find stats from a given year to this year

Post by JKM »

Hi there!

I was just wondering about how I could solve this 'issue'. I want to set a $startYear (to for example 2000) and do something like this:

Code: Select all

foreach(year) {
    $result .= 'blabla,';
}
echo $result;
DaiLaughing
Forum Commoner
Posts: 76
Joined: Thu Jul 16, 2009 8:03 am

Re: Stats question: Find stats from a given year to this year

Post by DaiLaughing »

Today's the day for me not understanding questions!

What sort of data is it, where is it coming from?

If you know what years exist then you could just use a FOR loop to cycle through them:

Code: Select all

for (year=1995;year<=2010;year++)
Post Reply