Q:

PHP program to calculate the md5 hash from plaintext

belongs to collection: PHP Miscellaneous

0

Here, we will calculate the md5 hash using the md5() function that encrypts the plaintext.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program/Source Code:

The source code to calculate the md5 hash from plaintext is given below. The given program is compiled and executed successfully.

<?php
//PHP program to calculate the md5 hash from plaintext.
$plaintext = "www.includehelp.com";
printf("Encrypted data: %s<br>", md5($plaintext));
?>

Output:

Encrypted data: 956006613d32bc33569dbb5bd1c32fea

Explanation:

Here, we created a local variable. After that, we called the md5() function that returns the encrypted data and then we printed the returned data using the printf() function on the webpage.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

PHP Miscellaneous

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
PHP program to convert a string into base64... >>
<< How to detect search engine bots with PHP?...