Easy Tutorial
❮ Php Preg_Last_Error Func Zip Entry Open ❯

PHP password_get_info() Function

PHP Password Hashing Algorithm

The password_get_info() function returns information about the specified hash.

PHP Version Requirements: PHP 5 >= 5.5.0, PHP 7

Syntax

array password_get_info ( string $hash )

Parameter Description:

Return Value

Returns an associative array with three elements:

Example

<?php
// Password
$password_plaintext = "12345";

// Create a hash using password_hash()
$password_hash = password_hash( $password_plaintext, PASSWORD_DEFAULT, [ 'cost' => 11 ] );

// View information
print_r( password_get_info( $password_hash ) );

Output:

Array
(
    [algo] => 1
    [algoName] => bcrypt
    [options] => Array
        (
            [cost] => 11
        )

)

PHP Password Hashing Algorithm

❮ Php Preg_Last_Error Func Zip Entry Open ❯