homepage Welcome to WebmasterWorld Guest from 23.20.220.79
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Efficiently Comparing File Modification Dates
ocon




msg:4587673
 4:10 am on Jun 26, 2013 (gmt 0)

My scripts constantly have to compare the modification dates of two files. To make the script work I have to clear my cache in PHP each time. Is there a more efficient way to compare file modification dates than this?

<?php
clearstatcache();
if(filemtime('file1.html') > filemtime('file2.html')){}
?>

 

phranque




msg:4587717
 7:47 am on Jun 26, 2013 (gmt 0)

Is there a more efficient way to compare file modification dates than this?

have you tried profiling this to see if it's actually a problem?

have you tried clearing the stat cache for the specific filenames to see if that improves anything significantly?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved