That's not possible with md5()
, The hash will never change for a given text , It's definitely wrong with your implementation.
The two cases of failure
Maybe you are passing the
md5()
hashed password as an argument to themd5()
function again and again.There maybe some whitespace getting added to your
$password
. Justtrim()
it as shown below.$password = md5(trim($password));
Remember : Even a space can change your hash.