Logo Search packages:      
Sourcecode: d-push version File versions  Download package

Mail_RFC822::isValidInetAddress ( data,
strict = false 
)

This is a email validating function separate to the rest of the class. It simply validates whether an email is of the common internet form: <user><domain>. This can be sufficient for most people. Optional stricter mode can be utilised which restricts mailbox characters allowed to alphanumeric, full stop, hyphen and underscore.

Parameters:
string$dataAddress to check
boolean$strictOptional stricter mode
Returns:
mixed False if it fails, an indexed array username/domain if it matches

Definition at line 915 of file z_RFC822.php.

    {
        $regex = $strict ? '/^([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i' : '/^([*+!.&#$|\'\\%\/0-9a-z^_`{}=?~:-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i';
        if (preg_match($regex, trim($data), $matches)) {
            return array($matches[1], $matches[2]);
        } else {
            return false;
        }
    }

Generated by  Doxygen 1.6.0   Back to index