How do I one-way encrypt a string in PHP?
<?php
$mydata = 'mypassword';
$code = crypt($mydata);
?>
Remember that this is a one way function, so if you use this when storing user password information, for instance, you will not be able to send them a password reminder but rather will need to identify them based on some other info (e.g. username and email combo) and then let them reset a password.
Comment on this Question and Answer >>>
ASK A QUESTION
More strings PHP Questions
How do I find the length of a string in PHP?How can I remove spaces from around a string value?
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 display newline characters on a webpage?
How do I convert newlines to HTML line break tags?
