I am a newb I have to admit at this programming lark (i have tried various
languages in the past but can't seem to find my way round them, but for once
I feel I am getting somewhere with php and have written my first functional
program that does something useful (well for me anyway!).
The purpose of the program is to read some logfiles we import to our
webserver and parse out some lines which are displayed on a website (near
real time stats essentially)
All this works fine but one part of my output does not read as I would
expect.
When my script reads each logfile it also picks up the date and time of the
last modified time of the file. As these logs are replaced every 10 minutes
its important I can see when the latest stats are essentially. I use the
filemtime() function.
The basic funtionality seems to work but the time I get out is odd. I have
broken my code down to a simple read the file time and print it on screen
but this returns the same time.
If I telnet to the server and read the last modded time it says (at present
10:22) But my php script outputs 10:02. This seems to stay like this for an
hour then outputs 11:02.
Its like it only sees hourly changes (always at 2 mins past the hour) I
thought it might be some sort of cacheing so have called clearstatcache() in
my script but this makes no difference. What time is this showing me here
then if its not the true system file modification time? any ideas?