password_verify() : Matching Password hash
$str="plus2net.com";
$str_hash=password_hash($str,PASSWORD_DEFAULT);
//echo $str_hash;
if(password_verify($str,$str_hash)){
echo " Matching ";
}else{
echo " Not matching ";
}
Output is
Matching
Syntax
password_verify('$entered_string',$hash_string);
Parameter | DESCRIPTION |
$entered_string | Required : Input password string ( user entered ) |
$hash_string | Required : Hash created by password_hash(). |
Output is Boolean , True or False
Always include the has variable in single quotes and not in double quotes. The presence of $ will change the value
crypt() and password_ferify()
$str="plus2net.com";
$str_crypt_hash = crypt($str);
///////////
if(password_verify('plus2net.com',$str_crypt_hash)){
echo " Matching ";
}else{
echo " Not matching ";
}
Output is
Matching
← String Functions password_hash(): Generate password hash →
mcrypt() function to work with different encryptions →
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com