I want to allow users to change their passwords, but the password has to be a 6 digit value. Is there a function that i could use to count the digits and validate the input?
Amongst the many possibilities:
if(ctype_digit($pwd) and strlen($pwd) == 6) { // valid }
if(preg_match('/^\d{6}$/', $pwd)) { // valid }
OK thank you!