note 6975 deleted from ereg by ronabop

From: Date: Sat, 12 Aug 2000 21:04:09 +0000
Subject: note 6975 deleted from ereg by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-1551@lists.php.net to get a copy of this message
Still sth about checking email:<br> I tried use a set of char to check the email addr, code like this: <br> $charset = '[0-9]|[A-Z]|[a-z]|[#$%^&*.:]';<br> $pattern = "$charset+@$charset+.$charset+";<br> $ret = ereg($pattern1, $email);<br> if ( $ret==1{ return 1; } <br> else{ return 0;} <br> it is work fine in check the existing of '@' and '.' in the email address, but when the addr contain some others char. (like '=', '(', ')'), it still can pass the checking. <br> What is the problem? I had not defined those chars in the pattern variable. <br> Thx a lot. (Sorry for bad english too. :) )

« previous php.notes (#1551) next »