note 116977 deleted from ref.password by tularis
| From: | tularis@php.net | Date: | Mon, 30 Mar 2015 12:11:31 +0000 |
| Subject: | note 116977 deleted from ref.password by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-202078@lists.php.net to get a copy of this message | ||
Note Submitter: Vladimir Kovpak
----
<?php
/**
* Simple example.
*/
$password = 'SECRET';
/**
* Prepare password to store at DB.
*/
$passwordHash = password_hash($password, PASSWORD_DEFAULT);
// Now $passwordHash contains string with length 60 characters,
// like: "$2y$10$wIUYtGKKVF3P3YO1O.IrI.Zav6j6H2/tCKEe4U/Mn8ykGVIyOlwZ."
// and it can be stored at DB.
/**
* Verify password.
*/
$isPasswordVerified = password_verify($password, $passwordHash);
// In our case $isPasswordVerified will contains true.
// It means that password verified.