Definition
The md5_file() function calculates the MD5 hash of a file.
Syntax
md5_file(file, raw)
Parameters
Parameter | Description |
---|---|
file |
Required. The file to be calculated. |
raw |
Optional. A boolean value that specifies hex or binary output format:true - Raw 16 character binary formatfalse - Default. 32 character hex number |
Example
<?php
$f = "sample.txt";
$md5file = md5_file($f);
echo $md5file;