Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Hi;
    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)
    http://img128.imageshack.us/my.php?i...livetxt9gx.jpg


    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...

  • #2
    Regular Coder dswimboy's Avatar
    Join Date
    Nov 2003
    Location
    mostly in Ann Arbor
    Posts
    458
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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() 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.
    "There is more than one way to do it."


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •