xt gohan Posted August 28, 2008 Share Posted August 28, 2008 Hey I've been using this function to determine the latest update file, but I'm not sure why I keep getting this error: Warning: filemtime() [function.filemtime]: stat failed for http1.doc in /home1/theninja/public_html/sitemaster/images.php on line 43 December 31 1969 17:00:00. function lastupdate () { $updated = scandir("images/scans/miami/", 1); foreach($updated as $key => $value) { if($value == ".." || $value == "." || $value == "error_log") { unset($updated[$key]); } } $page = $updated[0]; echo date("F d Y H:i:s.",filemtime($page)); } Can some please let me know what I am doing wrong with this function? I was trying my hardest to figure it out and I played around with it for a bit too. Basically it's supposed to scan the folders for images and pick out the time for the most recently modified/added. Link to comment https://forums.phpfreaks.com/topic/121771-solved-regarding-filemtime/ Share on other sites More sharing options...
BlueSkyIS Posted August 28, 2008 Share Posted August 28, 2008 is $page what you expect it to be? maybe try echoing out to make sure. Link to comment https://forums.phpfreaks.com/topic/121771-solved-regarding-filemtime/#findComment-628198 Share on other sites More sharing options...
xt gohan Posted August 28, 2008 Author Share Posted August 28, 2008 Holy crapola... Thanks - man, I feel so dumb right now. The other day my code wouldn't compile and I was looking at it for 3 hours to find that I left a semi-colon at the end of a variable... Link to comment https://forums.phpfreaks.com/topic/121771-solved-regarding-filemtime/#findComment-628204 Share on other sites More sharing options...
BlueSkyIS Posted August 28, 2008 Share Posted August 28, 2008 been there, done that. Link to comment https://forums.phpfreaks.com/topic/121771-solved-regarding-filemtime/#findComment-628209 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.