title: How to check if file hash has changed with php
body: <p>I have a php script that saves the file names of every file in directory to text file. That text file is then hashed. Here are the lines in my script:</p>
  
  <pre><code>$allnames = implode(",", $fileslist);
  
  file_put_contents($post_dir . "/md5file.txt",$allnames);
  
  $md5file = md5_file($post_dir . "/md5file.txt");
  
  echo $md5file;
  </code></pre>
  
  <p>If a new file is uploaded, removed, or a file name is changed then the hash will change. I need a way to check and see if that hash has changed or not. </p>