PHP md5 Function

What is md5 Function and how it is used in string?

Explanation

This function is used to calculate the md5 hash of a given string in PHP.

Syntax:


md5(string,raw)

In the above syntax "string" specifies the strings to calculate the md5 hash, "raw" specifies the output format if true then it will be in binary format else in hexa decimal format.

Example :


<?php
$str = "HIOX INDIA";
echo md5($str);
?>
Result :

3a1d5729f5301d8960e762f5751860d4

In the above md5 Function example the string "HIOX INDIA" is encrypted using md5 hash to display the result.

PHP Topics


Ask Questions

Ask Question