The following function will encrypt a given string using MD5.
"[The MD5 algorithm] takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. The MD5 algorithm is intended for digital signature applications, where a large file must be "compressed" in a secure manner before being encrypted with a private (secret) key under a public-key cryptosystem such as RSA."
The function:
<?php
function encrypt_s($string) {
$e_string = md5($string);
return $e_string;
}
?>
Usage:
<?php
echo encrypt_s("askdjasgh34");//Where "askdjasgh34" is the given string
?>