PHP md5_file Function
What is md5_file Function?
Explanation
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.
Syntax:
md5_file(file,raw)
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 :
<?php
$file = "test.txt";
$md5file = md5_file($file);
echo $md5file;
?>
Result :
3a1d5729f5301d8960e762f5751860d4
In the above example the "test.txt" contains the text "HIOX INDIA", which is encrypted in md5 hash to display the result.