Below are the contents file that has the IP address and time of visit of
visitors to a website.
68.122.69.241|1 089822686
68.122.69.241|1 089823630
68.122.69.241|1 089823638
68.122.69.241|1 089828547
The second column is the output of time()
I need a script to count each line in this file where the time stamp is
greater than time() - 3600*24. This will give number of visitors in the
last 24 hours. I also need number of visitors in the last 30 days, and
year. Should I use an array? Suggestions for getting started?
Thanks in advance.
visitors to a website.
68.122.69.241|1 089822686
68.122.69.241|1 089823630
68.122.69.241|1 089823638
68.122.69.241|1 089828547
The second column is the output of time()
I need a script to count each line in this file where the time stamp is
greater than time() - 3600*24. This will give number of visitors in the
last 24 hours. I also need number of visitors in the last 30 days, and
year. Should I use an array? Suggestions for getting started?
Thanks in advance.
Comment