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
Example
$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
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
← Subscribe to our YouTube Channel here