PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I calculate the MD5 hash of a string?


If that question makes no sense to you at all, then you probably don't have a need for this right now!

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

I retrieve data from a Mysql database and insert it into a textfield form. The data that I retrieve have a / at the end of the string. The data in the database does not have this / in the data. How do I remove this /?

How do I remove trailing whitespace from a string?

What is the difference between ' and "?

How do I extract the values of variables from a string?

How can I remove trailing space from a string?



Custom Search