I have written a password checker using PHP, consisting of many if else statements. Is there any possible way to shorten this code?function passtest($pass) {            if (!empty($pass)) { //check if string is empty                if (ctype_alnum($pass)) { //check if string is alphanumeric                    if (7 < strlen($pass)){ //check if string meets 8 or more characters                        if (strcspn($pass, '0123456789') != strlen($pass)){ //check if string has numbers                            if (strcspn($pass, 'abcdefghijklmnopqrstuvwxyz') != strlen($pass)) { //check if string has small letters                                if (strcspn($pass, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') != strlen($pass)) { //check if string has capital letters                                    return <br />Password passed;                                }                                else {                                    return <br />No capital letter;                                }                            }                            else {                                return <br />No small letter;                            }                        }                        else {                            return <br />No number;                        }                    }                    else {                        return <br />Password is short;                    }                }                else {                    return <br />Password has special character;                }            }            else {                return <br />Password field is empty;            }        }
Password checker in PHP
php;validation