Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

splitting a textarea field

Status
Not open for further replies.

krappleby025

Programmer
Joined
Sep 6, 2001
Messages
347
Location
NL
Hi all, i wonder if some one can give me a quick hand here.. im totally new to php, I have a text area field, which will contain email addresses, on a one per row basis, so for example, it will be filled in with

me@you.com
you@me.com
He@her.com etc

now i send the form to another script. and i need to send emails to each of these people, but the question is, how do i split the text area file...

so that i can mail to each individual address Instead of putting them into variables i want to send straight to them using

mail ("","$Subject","$Body","From: $myemail");

can someone please help

thanks
 
Assuming the textarea is named "foo" and the form is being sent to the script as POST method, something like:

$oof = explode ("\n", $_POST['foo']);

Will make $oof an array, breaking the input apart at the newlines.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top