大网数据广告活动
PHP 语言与运行手册

mcrypt_list_algorithms · 获取支持的加密算法

· 52CE 我爱测

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

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 起移除。强烈建议不要使用本函数。

说明

function mcrypt_list_algorithms(string $lib_dir = ini_get("mcrypt.algorithms_dir")): array

获取 lib_dir 中 包含的受支持的算法。

参数

lib_dir

指定算法所在的位置。 如果未指定,将使用 php.ini 中的 mcrypt.algorithms_dir 指示所指定的位置。

返回值

以数组方式返回所有受支持的算法。

示例

示例 #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
)

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。