← CodePrimer
PHP
Intermediate
Auth
Hash passwords with password_hash
How should I store passwords?
password_hash / password_verify.
<?php
$hash = password_hash($plain, PASSWORD_DEFAULT);
if (password_verify($plain, $hash)) {
echo 'Match';
}
Notes
Never store plain-text passwords.
Keywords: password · hash · bcrypt · auth · login
Related
PHP
Embed PHP inside HTML
How do I mix PHP and HTML?
PHP
PHP comments
How do I write comments in PHP?
PHP
PHP variable rules
What are the rules for PHP variables?
PHP
echo vs print
Should I use echo or print?
PHP
PHP scalar data types
What data types does PHP have?
PHP
Debug with var_dump
How do I inspect a variable’s type?