PHP Conference Japan 2024

mcrypt_list_algorithms

(PHP 4 >= 4.0.2, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)

mcrypt_list_algorithms取得所有支援的加密演算法陣列

警告

此函式自 PHP 7.1.0 起已被 _棄用_,並自 PHP 7.2.0 起已被 _移除_。強烈建議不要依賴此函式。

說明

mcrypt_list_algorithms(字串 $lib_dir = ini_get("mcrypt.algorithms_dir")): 陣列

取得 lib_dir 參數中所有支援的演算法清單。

參數

lib_dir

指定所有演算法所在的目錄。如果未指定,則使用 mcrypt.algorithms_dir php.ini 指令的值。

回傳值

返回一個包含所有支援演算法的陣列。

範例

範例 #1 mcrypt_list_algorithms() 範例

<?php
$algorithms
= mcrypt_list_algorithms();
print_r($algorithms);
?>

上述範例將輸出類似以下的內容

Array
(
    [0] => cast-128
    [1] => gost
    [2] => rijndael-128
    [3] => twofish
    [4] => arcfour
    [5] => cast-256
    [6] => loki97
    [7] => rijndael-192
    [8] => saferplus
    [9] => wake
    [10] => blowfish-compat
    [11] => des
    [12] => rijndael-256
    [13] => serpent
    [14] => xtea
    [15] => blowfish
    [16] => enigma
    [17] => rc2
    [18] => tripledes
)

新增註釋

使用者貢獻的註釋

此頁面沒有使用者貢獻的註釋。
To Top