Skip to content

Instantly share code, notes, and snippets.

@alibitek
Created June 2, 2016 07:53
Show Gist options
  • Save alibitek/1b4271073586bf58f1fecbcc60012f2a to your computer and use it in GitHub Desktop.
Save alibitek/1b4271073586bf58f1fecbcc60012f2a to your computer and use it in GitHub Desktop.
Password bcrypt hash verify
<?php
$hash = '<hash goes here>';
$pass = '<password goes here>';
$hash = password_hash($pass, PASSWORD_BCRYPT);
echo $hash;
if (password_verify($pass, $hash)) {
echo 'Password is valid!';
} else {
echo 'Invalid password.';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment