public function isRoleBased(string $email): bool
    {
        $user = mb_strtolower(mb_strstr($email, '@', true));
        $user = str_replace(['-', '_', '.'], '', $user);

        if (!is_null($is = &$this->cacheKey(__FUNCTION__, $user))) {
            return $is; // Cached this already.
        }
        if (in_array($user, $this::EMAIL_ROLE_BASED_STRINGS, true)) {
            return $is = true;
        }
        foreach ($this::EMAIL_ROLE_BASED_REGEX_FRAGS as $_regex_frag) {
            if (preg_match('/^'.$_regex_frag.'$/ui', $user)) {
                return $is = true;
            }
        } // unset($_regex_frag); // Housekeeping.

        return $is = false;
    }
public function isRoleBased(string $email): bool
    {
        $user = mb_strtolower(mb_strstr($email, '@', true));
        $user = str_replace(['-', '_', '.'], '', $user);

        if (!is_null($is = &$this->cacheKey(__FUNCTION__, $user))) {
            return $is; // Cached this already.
        }
        if (in_array($user, $this::EMAIL_ROLE_BASED_STRINGS, true)) {
            return $is = true;
        }
        foreach ($this::EMAIL_ROLE_BASED_REGEX_FRAGS as $_regex_frag) {
            if (preg_match('/^'.$_regex_frag.'$/ui', $user)) {
                return $is = true;
            }
        } // unset($_regex_frag); // Housekeeping.

        return $is = false;
    }
public function isRoleBased ( string $ email ) : bool { $ user = mb_strtolower ( mb_strstr ( $ email , '@' , true ) ) ; $ user = str_replace ( [ '-' , '_' , '.' ] , '' , $ user ) ; if ( ! is_null ( $ is = & $ this -> cacheKey ( __FUNCTION__ , $ user ) ) ) { return $ is ; // Cached this already. } if ( in_array ( $ user , $ this :: EMAIL_ROLE_BASED_STRINGS , true ) ) { return $ is = true ; } foreach ( $ this :: EMAIL_ROLE_BASED_REGEX_FRAGS as $ _regex_frag ) { if ( preg_match ( '/^' . $ _regex_frag . '$/ui' , $ user ) ) { return $ is = true ; } } // unset($_regex_frag); // Housekeeping. return $ is = false ; }
Is role-based address?

@since 151121 Email utilities.

@param string $email Email address to check.

@return bool True if email is role-based.
Is role - based address?