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 last occurrence of a character in a string?How do I display newline characters on a webpage?
How do I make the contents of a string lower case?
How do you hash the password in this php script: define(sb db user name, admin store); define(sb db password, mypassword);
How do I make sure a string is a certain length?
