当前位置:Gxlcms > PHP教程 > md516位二进制与32位字符串相互转换示例_php实例

md516位二进制与32位字符串相互转换示例_php实例

时间:2021-07-01 10:21:17 帮助过:5人阅读

代码如下:

$str = 'test';
$cm = md5($str);
$bm = md5($str, true);

$cstr = implode(unpack('H*', $bm));
$bstr = pack('H*', $cm);


echo 'str:'. $str . "
\n";
echo 'cm :' . $cm . "
\n";
echo 'cstr:' . $cstr . "
\n";
echo 'urlencode(bm) :' . urlencode($bm) . "
\n";
echo 'urlencode(bstr):' . urlencode($bstr) . "
\n";

人气教程排行