Home  >  Article  >  Backend Development  >  How to use php md5 function

How to use php md5 function

藏色散人
藏色散人Original
2019-02-11 11:16:353641browse

php The md5() function is used to calculate the MD5 hash value of a string. The syntax is md5(string,raw). This function returns an MD5 hash string (a sequence of lowercase hexadecimal characters of length 32 or the raw binary form of length 16).

How to use php md5 function

#php How to use the md5 function?

php The md5() function is used to calculate the MD5 hash value of a string.

Syntax:

md5(string,raw)

Parameters:

string: Required. Specifies the string to be calculated.

raw: Optional. Specifies hexadecimal or binary output format: TRUE - raw 16-character binary format, FALSE - default. 32-character hexadecimal number.

Description: Calculate the MD5 hash of the string

php md5() function example

<?php
echo MD5("php.cn");
?>

Output:

5038249e28843166c820ea820746febc

This This article is an introduction to the PHP md5 function. I hope it will be helpful to friends in need!

The above is the detailed content of How to use php md5 function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn