2 variables, random numbers and timestamps, read/write files
Posted: Sat May 30, 2009 6:28 am
I would like to implement a small php file to do the following when it is called...
Thanks for any help you can provide!!!
- read an XML file or text file and pull in two variables.
- the first variable (VAR1) is a number
- the second variable (VAR2) is a time-stamp
- compare the current time-stamp to VAR2
- if the times are more than 1 day apart, add a random number between 180 and 960 for each day apart to VAR1
- if the times are between 1 hour and 1 day apart, add a random number between 6 and 36 for each hour apart to VAR1
- if the times are between 1 minute and 1 hour, add a random number between 3 and 12 to VAR1
- if the times are less than 1 minute apart, add a random number between 1and 5 to VAR1
- update VAR2 with the current time-stamp
- In case it isn't obvious, write the updated VAR1 and VAR2 back to the file and close it
Thanks for any help you can provide!!!