PHP 8 · Web, security and database

Hash a password

Hash passwords with a strong algorithm and a built-in salt. Never store plain text.

$hash = password_hash($password, PASSWORD_DEFAULT);

Official PHP 8 documentation

More web, security and database commands

All web, security and database commands · PHP 8 cheatsheet

Was this page helpful?