(PHP 4, PHP 5, PHP 7)
md5 — Errechnet den MD5-Hash eines Strings
It is not recommended to use this function to secure passwords, due to the fast nature of this hashing algorithm. See the Password Hashing FAQ for details and best practices.
$str
[, bool $raw_output
= FALSE
] ) : string
Berechnet den MD5-Hash von str
unter Verwendung
des » RSA Data Security, Inc. MD5
Message-Digest Algorithm und gibt das Ergebnis zurück.
str
Die Zeichenkette.
raw_output
Wurde der optionale Parameter raw_output
mit TRUE
angegeben, wird der MD5-Wert im Raw Binary Format mit einer Länge von 16
Zeichen zurückgegeben.
Gibt den Hash als 32 Zeichen lange Hexadezimalzahl zurück.
Beispiel #1 Ein md5()-Beispiel
<?php
$str = 'apple';
if (md5($str) === '1f3870be274f6c49b3e31a0c6728957f') {
echo "Haetten Sie lieber einen gruenen oder einen roten Apfel?";
}
?>