Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
//Php Script to detect the files changed in a project recursively after a certain date
//Put here the directory you want to search for. Put / if you want to search your entire domain
//Put the date you want to compare with in the format of: YYYY-mm-dd hh:mm:ss
$comparedatestr="2020-01-21 00:00:00";
//I run the function here to start the search.
//This is the function which is doing the search...
function directory_tree($address,$comparedate){
@$dir = opendir($address);
if(!$dir){ return 0; }
while($entry = readdir($dir)){
if(is_dir("$address/$entry") && ($entry != ".." && $entry != ".")){
else {
if($entry != ".." && $entry != ".") {
$last_modified = filemtime($fulldir);
$last_modified_str= date("Y-m-d h:i:s", $last_modified);
if($comparedate < $last_modified) {
echo $fulldir.'=>'.$last_modified_str;
echo "<BR>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment