View Full Version : When Users Upload *.txt file, i will get Total Points ,Points Per Game ,etc...

06-15-2006, 06:45 PM
I have a online nba live (basketball game) site, i want to add following option.

When user upload *.txt file to my site (you will see at the picture)

i Want to get average and total stats.

For Example;
Total Points ,Points Per Game ,etc...

How do i make it?

Thanks for your help...

07-11-2006, 07:20 AM
are you familiar with php at all? are you using a database like mySQL?

the php manual will be a big help http://us3.php.net/manual/en/index.php

specifically i'd look at the preg_split() (http://us3.php.net/manual/en/function.preg-split.php) function to divide up your data into an array.

then i'd use the array_sum() function to find the sum, and array_sum()/count() to find averages.