One step closer to world domination
Simple Reg-Ex to Validate an Email Address
Regular expressions can be a pain sometimes. Here’s a code snippet to make your life a little easier when validating email addresses:
$email = 'user@example.com'; if (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $email)) { print_error("Your email address is invalid!"); }
| Print article | This entry was posted by Matt Danger on November 24, 2008 at 1:16 pm, and is filed under PHP. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed. |
Comments are closed.










