Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

md5_file

Description

Calculates the md5 hash of a given file

Syntax

md5_file ( string $filename [, bool $raw_output = FALSE ] ) : string

Parameters

filename

The filename

raw_output

When TRUE, returns the digest in raw binary format with a length of 16.

Return

Returns a string on success, FALSE otherwise.

Examples

1 · filename

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/file.txt';

$return = md5_file($filename);

echo $return;

?>
8b1a9953c4611296a827abf8c47804d7

2 · raw_output

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/file.txt';
$raw_output = true;

$return = md5_file($filename, $raw_output);

$unpack = unpack('H*', $return);
$array_pop = array_pop($unpack);

echo $array_pop;

?>
8b1a9953c4611296a827abf8c47804d7
HomeMenu