PHP 8 · Web, security and database

Check a password

Compare a password with a stored hash.

if (password_verify($password, $hash)) {
    // log the user in
}

Official PHP 8 documentation

More web, security and database commands

All web, security and database commands · PHP 8 cheatsheet

Was this page helpful?