小白教程
所有教程
关于
Search
172.70.131.52
172.70.131.52
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Php password get info”的源代码
本页内容
上一节:
Php_var_export_function
下一节:
Php_password_hash
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:password_get_info}}[[Category:php variable handling functions|36]] = PHP password_get_info() 函数 = [[php variable handling functions#password_hash|PHP 密码散列算法]] password_get_info() 函数用于返回指定散列(hash)的相关信息。 PHP 版本要求: PHP 5 >= 5.5.0, PHP 7 === 语法 === <sample title="" desc="" lang="php" hererun="1"> array password_get_info ( string $hash ) </sample> 参数说明: * $hash: 一个由 [[php password_hash|password_hash()]] 创建的散列值。 === 返回值 === 返回三个元素的关联数组: * algo: 匹配密码算法的常量。 * algoName: 人类可读的算法名称。 * options: 调用 password_hash() 时提供的选项。 == <sample title="" desc="" lang="php" hererun="1"> <?php // 密码 $password_plaintext = "12345"; // 使用 password_hash() 创建散列值 $password_hash = password_hash( $password_plaintext, PASSWORD_DEFAULT, [ 'cost' => 11 ] ); // 查看信息 print_r( password_get_info( $password_hash ) ); </sample> 输出结果为: <sample title="" desc="" lang="php" hererun="1"> Array ( [algo] => 1 [algoName] => bcrypt [options] => Array ( [cost] => 11 ) ) </sample> [[php variable handling functions#password_hash|PHP 密码散列算法]]
返回至“
Php password get info
”。
上一节:
Php_var_export_function
下一节:
Php_password_hash