473,322 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Validate Multiple E-mail ids

21
if i insert multiple e-mail id in To textbox like below , how can i validate the email ids.
<user1@example.com>, <user1@example.com>, "User 3" <user3@example.com>, "User 4" <user4@example.com>,

in google if we insert ids like above or comma separated , it will accept . anybody know the coding to validate this in PHP
Feb 16 '10 #1
2 1635
Atli
5,058 Expert 4TB
Hey.

Have you tried this yourself?
What did you try? Why/how didn't it work?

We are happy to help you develop your code, but we won't do it for you.

However, you are probably going to want to use a regular expression to do this. There are plenty of email-validation scripts available via Google. You would just have to adapt them to validate multiple addresses.
Feb 16 '10 #2
jyaseen
21
Yes I try this like below , my input E-mail id is

Expand|Select|Wrap|Line Numbers
  1. $email =  '"USER1" <user1@example.com>,"USER2" <user2@example.com>,
  2.  "User 3" <user3@example.com>, "User 4" <user4@example.com>, ";
  3.  
  4.  
  5.     $find = array('"Yunus Mecheri"','"unaise hameed"');
  6.  
  7.  
  8.     $arr = str_replace($find," ",$email,$i);
  9.     $arr = str_replace(">"," ",$email,$i);
  10.     $arr = str_replace("<"," ",$arr,$i);
  11.  
  12.     $final_email_ids = str_replace($find," ",$arr,$i);
if i enter array() manually , ie: $find . it will work , and it will give the output like
below :
user1@example.com,user2@example.com,user3@example. com,
use51@example.com,user4@example.com,
but if i use array to find the value automatically ie:instead of $find if i use like below ,
Expand|Select|Wrap|Line Numbers
  1. ARRAY(  0 =>"USER1"
  2.         1 =>"USER2"
  3.     2 =>"USER3"
  4.     3 =>"USER3"
  5.     4 =>"USER4"
  6. )
it will not work .
Feb 17 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Chris Kennedy | last post by:
Does anyone know a regular expression that will validate the file extension but also allow multiple file extensions if necessary. It also needs to be case insensitive. Basically, what I want is to...
4
by: Brybot | last post by:
I have a form that i've split up into multiple asp:panels, each panel has a number of validators which work correctly. At on the last panel, i want to commit the data collected to a database. I...
1
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
24
by: Mike Hofer | last post by:
Please forgive the cross-post to multiple forums. I did it intentionally, but I *think* it was appropriate given the nature of my question. I'm working on an open source code library to help...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.