How do I calculate the MD5 hash of a string?
However lots of people do, and the good news is that it's really easy with the built-in PHP function, so here goes with the answer:
<?php
$text = "Give me some space";
$md5 = md5($text);
?>
That's all there is to it. And for those of you still wondering what this is all about, essentially it's a secure hashing function. The interesting thing is that no matter how long the data stream it converts it into a digest of a fixed size.
Comment on this Question and Answer >>>
ASK A QUESTION
More strings PHP Questions
What is the usage of { } in string handling in php?How do I remove trailing whitespace from a string?
How do I convert relevant characters in a string to HTML entities?
How can I repeat a string variable several times?
How can I repeat a string several times?
