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);
ParameterDESCRIPTION
$entered_stringRequired : Input password string ( user entered )
$hash_stringRequired : 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


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Post your comments , suggestion , error , requirements etc here





    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2023 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer