array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.mcrypt-list-modes.php', 1 => 'mcrypt_list_modes', ), 'up' => array ( 0 => 'ref.mcrypt.php', 1 => 'Mcrypt 函数', ), 'prev' => array ( 0 => 'function.mcrypt-list-algorithms.php', 1 => 'mcrypt_list_algorithms', ), 'next' => array ( 0 => 'function.mcrypt-module-close.php', 1 => 'mcrypt_module_close', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/mcrypt/functions/mcrypt-list-modes.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.2, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)
mcrypt_list_modes — 获取所支持的模式
本函数已自 PHP 7.1.0 起废弃并将自 PHP 7.2.0 起移除。强烈建议不要使用本函数。
lib_dir
指定模式所在的位置。
如果未指定,将使用 php.ini
中的 mcrypt.modes_dir
指示所指定的位置。
以数组形式返回受支持的模式。
示例 #1 mcrypt_list_modes() 示例
<?php
$modes = mcrypt_list_modes();
foreach ($modes as $mode) {
echo "$mode <br />\n";
}
?>
本示例列出在默认目录中
所有受支持的模式。
如果在 php.ini 中未指定 mcrypt.modes_dir
,
则使用默认的 mcrypt 库
安装目录(/usr/local/lib/libmcrypt)。