note 87156 added to function.ereg
| From: | hreisinatgmaildotcom at osu1 dot php dot net | Date: | Fri, 21 Nov 2008 21:50:04 +0000 |
| Subject: | note 87156 added to function.ereg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146812@lists.php.net to get a copy of this message | ||
Hi,
for those looking for email adress PHP validation,
isemail is a javascrit function that checks the following conditions for the email string:
⢠only one @ sign permitted
⢠domain extension separator (.) must come after the @ symbol
⢠must be at least 2 characters (letters) after the domain extension separator (.)
⢠rejects all illegal characters including spaces.
⢠Allows only numbers, letters, the underscore (_) and the dash (-) character as valid input
(excluding the mandatory "@" and "." symbols).
⢠Minimum of 6 characters
The following pattern satisfy all-in-one for the ereg function:
$pattern = "^([A-Za-z0-9\.|-|_]{1,60})([@])";
$pattern .="([A-Za-z0-9\.|-|_]{1,60})(\.)([A-Za-z]{2,3})$";
ereg($pattern,$email)
----
Server IP: 190.2.55.3
Probable Submitter: 201.253.71.115
----
Manual Page -- http://www.php.net/manual/en/function.ereg.php
Edit -- https://master.php.net/note/edit/87156
Del: integrated -- https://master.php.net/note/delete/87156/integrated
Del: useless -- https://master.php.net/note/delete/87156/useless
Del: bad code -- https://master.php.net/note/delete/87156/bad+code
Del: spam -- https://master.php.net/note/delete/87156/spam
Del: non-english -- https://master.php.net/note/delete/87156/non-english
Del: in docs -- https://master.php.net/note/delete/87156/in+docs
Del: other reasons-- https://master.php.net/note/delete/87156
Reject -- https://master.php.net/note/reject/87156
Search -- https://master.php.net/manage/user-notes.php