Is there a way in PHP to detect when a file is updated and saved?
If not what would be the best method ‘faking’ this.
I.e. before a certain action if executed, check the last saved date of the file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A PHP script would not be able to automatically detect changes to files because the page has to be requested. You could write a script and run a cron (scheduled task) to run every so often. Or use filemtime() as others have suggested.