Retrieving last modified timestamp for a file

CODE:
  1. <?php
  2. //set path/filename or passed from form argument
  3. $filename = '/path/filename.dat';
  4. // checks that the file actually exists and queries the last modified timestamp
  5. if (file_exists($filename)) {
  6.         echo "$filename exists";
  7.         echo " last timestamp: " . date("d-m-y", filemtime($filename));
  8. } else {
  9.         echo "$filename does not exist";
  10. }
  11. ?>