Table of Contents

Syntax

string md5_file(string $fileName [, bool $rawOutput = false ])

(PHP 4, PHP 5)

$fileName The source file from which to compute an MD5 hash.
$rawOutput If this is set to true, output the result as raw binary.
RETURNS A message digest hash for the file referenced by $fileName or false if an error occurs (such as file not found).

What it Does

Computes a message digest hash (MD5) for the contents of the specified file ($fileName). This file must exists on the local filesystem (where the script is run) otherwise the method will return false.

Example

// compute an MD5 hash for this script
$md5 = md5_file(__FILE__);
echo 'MD5 hash result: '.$md5;
 
md5_file.txt · Last modified: 2011/02/11 14:04 by orvado
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki