www.webdeveloper.com
Results 1 to 6 of 6

Thread: wierd combine of arrays for e-mail

  1. #1
    Join Date
    Jul 2007
    Posts
    25

    Lightbulb wierd combine of arrays for e-mail

    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...)

    PHP Code:
    // 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 ]***
    Last edited by guyjusthere; 09-02-2007 at 10:18 PM.

  2. #2
    Join Date
    Jul 2007
    Posts
    25
    helpp

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,384
    Two nested foreach loops should do the trick.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Jul 2007
    Posts
    25
    i need code.. im no good with php

  5. #5
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,384
    PHP Code:
    $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;
       }

    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  6. #6
    Join Date
    Jul 2007
    Posts
    25
    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?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles