sphinx Posted December 8, 2010 Share Posted December 8, 2010 Hello. Would php be the right thing to use in regards to monitoring changes in html on certain pages, Basicly, I'd need it to be something like: "Page last changed: 2 Days, 4 Hours, 34 Minutes and 13 Seconds ago." What would I use for this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/221056-detect-page-changes/ Share on other sites More sharing options...
Maq Posted December 8, 2010 Share Posted December 8, 2010 Hello. Would php be the right thing to use in regards to monitoring changes in html on certain pages, Basicly, I'd need it to be something like: "Page last changed: 2 Days, 4 Hours, 34 Minutes and 13 Seconds ago." What would I use for this? Thanks Not sure I understand exactly what you're trying to do. How do you plan on going about this? If I guessed correctly, you could make a hash of the page and check it against the old one. Quote Link to comment https://forums.phpfreaks.com/topic/221056-detect-page-changes/#findComment-1144654 Share on other sites More sharing options...
AbraCadaver Posted December 8, 2010 Share Posted December 8, 2010 echo "Page last changed: " . date ("F d Y H:i:s.", getlastmod()); Or you can subtract it from time() and then use some simple division to get the days, hours, minutes, seconds. Quote Link to comment https://forums.phpfreaks.com/topic/221056-detect-page-changes/#findComment-1144665 Share on other sites More sharing options...
sphinx Posted December 8, 2010 Author Share Posted December 8, 2010 Hello. Would php be the right thing to use in regards to monitoring changes in html on certain pages, Basicly, I'd need it to be something like: "Page last changed: 2 Days, 4 Hours, 34 Minutes and 13 Seconds ago." What would I use for this? Thanks Not sure I understand exactly what you're trying to do. How do you plan on going about this? If I guessed correctly, you could make a hash of the page and check it against the old one. That's what I mean Quote Link to comment https://forums.phpfreaks.com/topic/221056-detect-page-changes/#findComment-1144693 Share on other sites More sharing options...
AbraCadaver Posted December 8, 2010 Share Posted December 8, 2010 Hello. Would php be the right thing to use in regards to monitoring changes in html on certain pages, Basicly, I'd need it to be something like: "Page last changed: 2 Days, 4 Hours, 34 Minutes and 13 Seconds ago." What would I use for this? Thanks Not sure I understand exactly what you're trying to do. How do you plan on going about this? If I guessed correctly, you could make a hash of the page and check it against the old one. That's what I mean How so? If for the current page just use getlastmod(). If you want to do this for other pages use filemtime(). The filesystem knows when the file last changed. Quote Link to comment https://forums.phpfreaks.com/topic/221056-detect-page-changes/#findComment-1144705 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.