PHP md5_file() Function

PHP md5() Function
PHP metaphone() Function

what is the syntax of the MD5_FILE() function in php?

md5_file(file,raw)
ParameterDescription
fileRequired. The file to be calculated
rawOptional. A boolean value that specifies hex or binary output format:TRUE – Raw 16 character binary formatFALSE – Default. 32 character hex number
PHP md5_file() method

examples of the MD5_FILE() function

Example 1. In this example, we calculate the MD5 hash of the text file “test.txt”.

<?php
$filename = "test.txt";
$md5file = md5_file($filename);
echo $md5file;
?>

Example 2. In this example, we store the MD5 hash of “test.txt” in a file.

<?php
$md5file = md5_file("test.txt");
file_put_contents("md5file.txt",$md5file);
?>
PHP md5() Function
PHP metaphone() Function
en English
X
Scroll to Top