$dirTwo = opendir($dir_nameTwo); //opens the directory defined above while ($file_name = readdir($dirTwo)) //reads through the files in the destination directory { $file_date = date("F d Y H:i:s.", filectime($dir_nameTwo."/".$file_name)); //gets the file date if (($file_name != ".") && ($file_name != "..") && $file_name != ".htaccess") //ignore the parent directory and list the rest of the files in the destination directory { $file_listTwo .= "