Hello everyone, new to the forum here. I have exhausted all my options on getting my little idea to work. So I am hoping maybe someone here can help.
First off, assume I know very little about PHP 🙂
This is the idea:
Have a Form where a user can input an elapsed time for an x amount of races (video game)
example : 2'34.765 or : 2:34.765
Input is in minutes, seconds, milliseconds.
Have the info from the Form sent to a PHP script that would add up all the elapsed times, 'echo' the total time, and then calculate the average elapsed time for the x amount of races, and 'echo' that as well.
I am hitting a brick wall in all this time conversion...ie., getting PHP to add all the minutes, seconds, and milliseconds....I think maybe it is a formatting issue as the Form passes the info to the script as example : 2'34.765 or : 2:34.765.
I did manage to get a script working, but the user would have to input their elapsed time in seconds.milliseconds, not minutes:seconds.milliseconds. Therefore the user would have to convert their times before even submitting them. NOT GOOD LOL!!
My script added up the total seconds, and converted them to minutes:
example : 105.xxx seconds would output 1.75xxxx minutes
My desired output would be 1:45.xxx
Is this even possible? Does anyone understand what I am trying to do?? LOL
Any help would be GREATLY appreciated.