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 print text to the screen?How can I repeat a string several times?
How do we count paragraphs or newlines?
How do I find the length of a string in PHP?
How do I break email address into username and hostname?
