= 8) $strength++; //check if caps if(preg_match('/[A-Z]/', $password)) $strength++; //check if lower cases if(preg_match('/[a-z]/', $password)) $strength++; //check if numbers if(preg_match('/[0-9]/', $password)) $strength++; //check if spec. chars if(preg_match('/[^a-zA-Z0-9]/', $password)) $strength++; return($strength >= 5); }