Password Hashing
password_hash makes a salted hash and password_verify checks it. Never store plain passwords.
Example
$h = password_hash("secret", PASSWORD_DEFAULT);
var_dump(password_verify("secret", $h), password_verify("wrong", $h));Result
bool(true) bool(false)
Exercise
Check a password.
("secret", $h)Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.