![]() Topic awaiting preservation: File last modified in PHP (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: New Jersey, USA |
![]() I'm trying to write a script that opens a directory, goes through all the files, and sorts them according to the times the files were last modified. I've got the part of the script done that gets the files. I'm running into trouble when I try to get the modified times for each file. I'm using the filemtime() function. The strange part is, I get a date and time that makes sense on the . and .. files in the directory, but the files *I* put there all have the exact time and date. Now this may not seem to strange except the date and time on all of them is "31 December 1969 16:00". |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() getlastmod() |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() Thanks Mage |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() mr.maX |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() You didn't specify valid filename in filemtime() function call... It should be called like this: |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() I saw your reply in the other thread, I was working on that just before I came back here. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() Hmm, I've tested your code from above (with my fix) and everything worked fine... Anyway, try the following *simple* script (put it in the *same* folder where all other files are located): |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() Yes, the script you wrote works from within the same folder I am trying to get the file info from. I modified my script and put it in the same file and it worked also. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() Ok, now that it partially works, let's try the following script (put it one level up from "includes" folder): |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() Thanks mr.maX |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() |