User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,913 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,718 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 867 | Replies: 2
Reply
Join Date: Aug 2007
Posts: 2
Reputation: Mohit_Agarwal is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Mohit_Agarwal Mohit_Agarwal is offline Offline
Newbie Poster

Question storing multiple email address problem

  #1  
Aug 21st, 2007
hello all
i am new to php.i don't know
how to use split function for separating multiple email addresses and storing in an array and then printing that each value of array...

if anybody can help me out then i will be thankful to him/her.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2006
Location: Netherlands
Posts: 223
Reputation: Anonymusius is on a distinguished road 
Rep Power: 2
Solved Threads: 10
Anonymusius's Avatar
Anonymusius Anonymusius is offline Offline
Posting Whiz in Training

Re: storing multiple email address problem

  #2  
Aug 21st, 2007
Well, to take the easier part first, the printing of each value of an array:
<?php
foreach($array as $key => $val){
echo "$key = $val <br />";
}

Now to separate email addresses, that depends on how the string with the email addresses is formatted. if it's just separated with comma's, I would use explode:
$array = explode(',', $emailString);
But if the separator between the email addresses isn't constant, you should indeed go with regex (with the split function).

Off course there are lots of ways of doing it. I think you could to do it with preg_match_all();

You should post an example of the string you want splitted looks like.
Reply With Quote  
Join Date: Aug 2007
Posts: 2
Reputation: Mohit_Agarwal is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Mohit_Agarwal Mohit_Agarwal is offline Offline
Newbie Poster

Re: storing multiple email address problem

  #3  
Aug 21st, 2007
Thanks
ya you are right by this way
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 7:53 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC