PHP provide a variety of function to get our source secure. This simple article shows how to use the md5() function to encrypt data, especially passwords in the database.
The code is easy:
$password = "test"; // define a password variable, assign “test” value to it
$encryptedpassword = md5($password); //encrypting the password using md5()
echo "Password before encryption: $password"; // write the original password
echo "Password after encryption: $encryptedpassword"; // write the encrypted password
?>
the out put gonna be:
Password before encryption: test
Password after encryption: 098f6bcd4621d373cade4e832627b4f6




