PHP - password_verify
Trieda
Metóda - password_verify
(PHP 5 >= 5.5.0, PHP 7)
Matches the given hash with the given password.
Procedurálne
- function password_verify (string $password, string $hash) : boolean
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $password | string | The input password. | |
| $hash | string | The input hash created using the |
Mávratovej hodnoty
Vracia: boolean
Returns true if the hash and the password match,
false otherwise.
Príklady
$hash = '$2y$07$BCryptRequires22Chrcte/VlQH0piJtjXl.0t1XkA8pw9dMXTpOq';
$inputPassword = 'rasmuslerdorf';
echo password_verify($inputPassword, $hash) ? 'Password verified.' : 'Incorrect password.'.
Súvisiace manuály
- function password_hash (string $password, integer $algo, array $options) : string
