Click to See Complete Forum and Search --> : wierd combine of arrays for e-mail


guyjusthere
09-02-2007, 10:14 PM
i need to mix up two arrays...
on is phone #'s generated from txt
the other is email adresses.. (I need to sms/email message phone numbers to all carriers since i don't know which phone service they have...)

// read the list of emails from the file.
$email_list = file("../_private/maillist.txt");

// count how many emails there are.
$total_emails = count($email_list);
// go through the list and trim off the newline character.
for ($counter=0; $counter<$total_emails; $counter++) {
$email_list[$counter] = trim($email_list[$counter]);
}

// implode the list into a single variable, put commas in, apply as $to value.
$sms = array("@message.alltel.com","bellsouth.cl","csouth1.com","@mobile.celloneusa.com","@mycellone.com","@mobile.mycingular.com","@imcingular.com","@mobile.mycingular.com","mymetropcs.com","@messaging.nextel.com","messaging.sprintpcs.com","@sprintpcs.com","@tmomail.net","@tmail.com","@myairmail.com","@vmobl.com");


//if ( mail($to,$subject,$message) ) {
// echo "The email has been sent!";
// } else {
// echo "The email has failed!";
// }

how do i mix $sms with $email_list so each number gets added to EACH E-mail...

example:
$poo = [ 1 , 2 , 3 ]
$ass = [ a , b , c ]
now mix them and i need
****$IWANT = [ 1a , 1b, 1c , 2a , 2b , 2c, 3a , 3b , 3c ]***

guyjusthere
09-02-2007, 10:27 PM
helpp

NogDog
09-02-2007, 10:59 PM
Two nested foreach loops should do the trick.

guyjusthere
09-03-2007, 12:38 AM
i need code.. im no good with php

NogDog
09-03-2007, 12:54 AM
$new_array = array(); // initialize new empty array
foreach($array_1 as $value_1)
{
foreach($array_2 as $value_2)
{
$new_array[] = $value_1 . $value_2;
}
}

guyjusthere
09-03-2007, 01:40 AM
damn i was so close to doing it myself.. THANKS.. is there any way to prevent the email to send the return address as the header... and if im e-mailing ALOT of people at the same time, should i stray from the mailto script?