共計 598 個字符,預計需要花費 2 分鐘才能閱讀完成。

php 中常見的加密函數有 md5、sha1、hash、urldecode 幾種
1.md5 函數
md5 函數作用:
php 中 md5 函數的作用是將字符串轉換成 MD5 散列用于加密。
md5 函數語法:
md5(string,raw)
參數:
string:指定字符串。
raw:規定以十六進制或二進制輸出格式。
md5 函數使用方法:
$str = "Hello";
echo md5($str);
2.sha1 函數
sha1 函數作用:
php 中 sha1 函數的作用是將字符串轉換成 SHA- 1 散列用于加密。
sha1 函數語法:
sha1(string,raw)
參數:
string:指定字符串。
raw:規定以十六進制或二進制輸出格式。
sha1 函數使用方法:
$str = "Hello";
echo sha1($str);
3.hash 函數
hash 函數作用:
php 中 hash 函數的作用是將字符串轉換成 hash 散列用于加密。
hash 函數語法:
sha1(raw,string)
hash 函數使用方法:
$str = hash("md5","1565456")
echo $str;
4.urldecode 函數
urldecode 函數作用:
php 中 urldecode 函數的作用是對中文字符串進行加密。
urldecode 函數語法:
urldecode(string)
urldecode 函數使用方法:
$str = urldecode(" 億速 ")
echo $str;
丸趣 TV 網 – 提供最優質的資源集合!