使用函数
md5()A md5() example
<?php
$str = 'apple';if (md5($str) === '1f3870be274f6c49b3e31a0c6728957f') {
    echo "Would you like a green or red apple?";
    exit;
}
?>

解决方案 »

  1.   

    在PHP中md5加密是内置的
    可以直接使用啊
    $aa = md5("你的变量");
    echo $aa;    //就可以得到你的变量加密之后的结果
      

  2.   

    计算字符串的 MD5 哈稀。语法: string md5(string str
    本函数用来计算 MD5 哈稀。关于 MD5 编码法,可以参考 RSA Data Security, Inc. MD5 Message-Digest Algorithm. RFC1321;或是赖溪松、韩亮、张真诚等合着之近代密码学及其应用,11.3。
    <?php
    $str = 'apple';if (md5($str) === '1f3870be274f6c49b3e31a0c6728957f') {
        echo "Would you like a green or red apple?";
        exit;
    }
    ?> string md5_file ( string filename [, bool raw_output])
    Calculates the MD5 hash of the specified filename using the RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash. The hash is a 32-character hexadecimal number. If the optional raw_output is set to TRUE, then the md5 digest is instead returned in raw binary format with a length of 16.