php password_hash and password_verify issues no match
I am trying out a new function from PHP 5.5 called password_hash(). No matter what i do the $hash and the $password wont match. $password = "test"; $hash = "$2y$10$fXJEsC0zWAR2tDrmlJgSaecbKyiEOK9GDCRKDReYM8gH2bG2mbO4e"; if (password_verify($password, $hash)) { echo "Success"; } else { echo "Error"; } The problem with your code is that you are using the double quotation marks " instead of the single quotation marks ' when dealing with your hash. When assigning: $hash = "$2y$10$fXJEsC0zWAR2tDrmlJgSaecbKyiEOK9GDCRKDReYM8gH2bG2mbO4e"; It's making php think you have a variable called $2y and