The md5_file function returns the md5 hash of a string.

    
    $file = 'data.txt';
    $fileMd5 = md5_file($file);

    echo $fileMd5;
    // 5d41402abc4b2a76b9719d911017c592