i'm developing an app that i intend to run on a client's intranet. i want to ensure that only email addresses with the client's domain should be registered. how do i achieve this using regular expressions?
dinhunzvi
0
Newbie Poster
Recommended Answers
Jump to PostAre you using PHP 5.2 or above?
If so, you could use to validate the email address as a whole:
filter_var('bob@example.com', FILTER_VALIDATE_EMAIL);
And then using strpos and substr extract the domain element and do a string comparison to restrict the domain.
All 4 Replies
blocblue
238
Posting Pro in Training
Featured Poster
lixamaga
0
Newbie Poster
cereal
1,524
Nearly a Senior Poster
Featured Poster
dinhunzvi
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.