array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.md5-file.php', 1 => 'md5_file', ), 'up' => array ( 0 => 'ref.strings.php', 1 => 'String Functions', ), 'prev' => array ( 0 => 'function.ltrim.php', 1 => 'ltrim', ), 'next' => array ( 0 => 'function.md5.php', 1 => 'md5', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/strings/functions/md5-file.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
md5_file — Calculates the md5 hash of a given file
Calculates the MD5 hash of the file specified by the
filename
parameter using the
» RSA Data Security, Inc.
MD5 Message-Digest Algorithm, and returns that hash.
The hash is a 32-character hexadecimal number.
filename
The filename
binary
When true
, returns the digest in raw binary format with a length of
16.
Returns a string on success, false
otherwise.
Example #1 Usage example of md5_file()
<?php
$file = 'php-5.3.0alpha2-Win32-VC9-x64.zip';
echo 'MD5 file hash of ' . $file . ': ' . md5_file($file);
?>