NOVINKA: Najžiadanejšie rekvalifikačné kurzy teraz s 50% zľavou + kurz AI ZADARMO. Nečakaj, táto ponuka dlho nevydrží! Zisti viac:

PHP - password_verify

Trieda

Koreň \ Bez triedy

Metóda - password_verify

(PHP 5 >= 5.5.0, PHP 7)

Matches the given hash with the given password.

Procedurálne

Parametre

NázovDátový typPredvolená hodnotaPopis
$passwordstring

The input password.

$hashstring

The input hash created using the password_hash() function.

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
      Aktivity