I am trying to delete a $lockfile if the timestamp is more than 20 minutes.
if (file_exists($lockfile) && time() - filemtime($lockfile) > strtotime("+20 minutes")) {
// If lockfile is alive for more than 20 minutes, unlink it
unlink($lockfile);
}
I can not figure out why it is not working. Probably something simple that I am overlooking right now. Thank you in advance!