Forum Moderators: coopster

Message Too Old, No Replies

PHP commands to get image creation date & last access

         

smagdy

2:53 pm on Sep 24, 2007 (gmt 0)

10+ Year Member



Hello!

I have PHP 5 and users upload images while they put some info and all of these data are deleted after some period of time, but i am just afraid in case of any error some images stay there in the server!

So I want to know how to check its last accessed date and creation date and any info related to date, so i regularly check and delete when expired!

Thanks in advance

eelixduppy

3:11 am on Sep 29, 2007 (gmt 0)



You should be able to use filemtime [us3.php.net] or stat [php.net] to get the desired result that you want. You just have to change the date you want to a UNIX timestamp in order to compare the two values appropriately.

good luck :)

smagdy

3:44 am on Sep 29, 2007 (gmt 0)

10+ Year Member



Thanks, but how to get the file time or stat in PHP?

smagdy

3:46 am on Sep 29, 2007 (gmt 0)

10+ Year Member



Oops sorry, i didnt see the links as i was checking this from mobile phone... Thanks i will check them from PC soon!