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

md5

Description

The md5 of String for PHP calculate the md5 hash of a string.

Syntax

md5(
    string $string,
    bool $binary = false
): string

Parameters

string

The string.

binary

If the optional binary 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

1 · string

<?

$string = 'hello';

$return = md5($string);

echo $return;

?>
5d41402abc4b2a76b9719d911017c592

2 · binary

<?

$string = 'hello';
$binary = true;

$return = md5($string, $binary);

echo $return . PHP_EOL;

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

$array_pop = array_pop($unpack);

echo $array_pop;

?>
]A@*�K*v�q��Œ
5d41402abc4b2a76b9719d911017c592
HomeMenu