Home Menu

md5

Calculate the md5 hash of a string

Syntax

md5 ( string $str [, bool $raw_output = FALSE ] ) : string

Parameters

str

The string.

raw_output

If the optional raw_output is set to TRUE, then the md5 digest is instead returned in raw binary format with a length of 16.

Return

Returns the hash as a 32-character hexadecimal number.

Examples

str

<?

$str = 'Hello';

$return = md5($str);

echo $return;

?>
8b1a9953c4611296a827abf8c47804d7

raw_output

<?

$str = 'Hello';
$raw_output = true;

$return = md5($str, $raw_output);

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

echo $array_pop;

?>
8b1a9953c4611296a827abf8c47804d7

PHP

JesusBible
HTMLCSSJSPHPSVGMore
AboutTerms