Home > Article > Backend Development > What does md5 convert the value to in php?
In PHP, the md5() function can convert the value into a calculated MD5 hash. This function is used to calculate the MD5 hash of the string. If the function fails, the returned result is false. Syntax It is "md5 (string to be calculated, hexadecimal or binary output format)".
The operating environment of this article: Windows 10 system, PHP version 7.1, Dell G3 computer.
The md5() function calculates the MD5 hash of the string.
The md5() function uses RSA data security, including the MD5 message digest algorithm.
The syntax is as follows:
md5(string,raw)
The parameters are as follows:
string Required. Specifies the string to be calculated.
raw Optional. Specifies hexadecimal or binary output format:
# is returned ##Examples are as follows:
<?php $str = "Shanghai"; echo "字符串:".$str."<br>"; echo "TRUE - 原始 16 字符二进制格式:".md5($str, TRUE)."<br>"; echo "FALSE - 32 字符十六进制格式:".md5($str)."<br>"; ?>
Output results:
Recommended learning: "
PHP Video TutorialThe above is the detailed content of What does md5 convert the value to in php?. For more information, please follow other related articles on the PHP Chinese website!