English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP md5() Function Usage and Example

PHP String String Function Manual

md5() function is used to calculate the MD of the string5 Hash Value.

Syntax

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

Definition and Usage

Used to calculate the MD of the string5Hash Value

Return Value

It returns32Returns the hash value in hexadecimal number form of a character

Parameter

NumberParameter and Description
1

str

Original String.

2

raw_output

If the optional raw_output is set to TRUE, then the MD5 Message digest will be16Returns the original binary format of byte length.

Online Example

Try the following example to calculate the string "w3MD of codebox.com"5 Hash Value

<?php
   //Use md5() function to calculate the string "w3MD of codebox.com" using the MD5 Hash Value
   $str = "oldtoolbag.com";
   
   echo md5($str);
?>
Test and see‹/›

Output Result

c398ee9acf1e83e723b9302fa5c73bc3

PHP String String Function Manual