PHP md5_file Function

What is md5_file Function?


In PHP, this function is used to calculate the md5 hash of a given file.The MD5 message-digest algorithm takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest". Its usually used to compress large files.



In the above syntax "file" specifies the file to calculate the md5 hash, "raw" specifies the output format if true then it will be in binary format else in hexa decimal format.

Example :

$file = "test.txt";
$md5file = md5_file($file);
echo $md5file;
Result :


In the above example the "test.txt" contains the text "HIOX INDIA", which is encrypted in md5 hash to display the result.

PHP Topics

Ask Questions

Ask Question