password_verify() : Matching Password hash

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

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


plus2net.com




PHP String Functions

Post your comments , suggestion , error , requirements etc here .




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