2 simple questions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

2 simple questions

Post by psychotomus »

How can I check if an email address is in valid format?


#2. Is there a simple way to check if a string contains a-z A-Z 0-9 - _ only.
User avatar
xinnex
Forum Commoner
Posts: 33
Joined: Sun Jan 07, 2007 7:38 pm
Location: Copenhagen, Denmark

Post by xinnex »

Search the forums for "regexp" and "regular expression", there's lots of resources.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

There is a forum dedicated to them on here
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

There's a function I've referenced many times called validateEmailFormat that will ... validate an email address to comply with RFC guidelines.

As for the second part, the regex board has many examples to learn from.
Post Reply