|
thank you guys, you are right, I need to clarify it a little bit.
1. I saved data into a array, data[] (say 365 days data).
2. I need print X days average line on the screen.
3. I want to create a FUNCTION to do that.
4. user can define X=5 days or 10 days whatever they want.
the math is there, I knew that, but I am new to PHP, I need some help to make that FUNCTION to calculate.
my thought is:
first, take last X days data, dividen them by X, then sum them. save it to a array. then do second .......
but not get it yet, any open source available?
Thanks.
Last edited by rcajht; 11-20-2009 at 10:37 PM..
|