Hi

    Following is the piece of code, which I am struggling with, now & the
problem is:

    I just want to display 4 email address in a textarea and mail them. The
case here is, the available email address has to displayed and as I have
maximum 4 email addresses coming up dynamically, I might get all the
combinations, like 1&2, 1&3, 1&4, 2&3, 3&4 etc. Depending upon that I just
want to split them up, with a separation and that's a comma (,).

    If I have the following piece of code executed, it just prints two
commas in between, in the case of 1st email address and the 4th email
address - like this: [EMAIL PROTECTED],,[EMAIL PROTECTED] (note
two commas in between the email addresses)

    Instead I would like to get rid of one comma in between the email
address and just display and sepearte it with only comma, instead of two
commas and it should work for all the combinations that's possible.

    What are the possible ways to do that ?. Even I am trying out here.

    My Code:

   if ($svars[home_email1]!=='')
   {
    $vars["send_email"] .= $svars["home_email1"];
   }
   if ($svars[home_email2]!=='')
   {
    $vars["send_email"] .= $comma;
    $vars["send_email"] .= $svars["home_email2"];
   }
   if ($svars[work_email1]!=='')
   {
    $vars["send_email"] .= $comma;
    $vars["send_email"] .= $svars["work_email1"];
   }
   if ($svars[work_email2]!=='')
   {
    $vars["send_email"] .= $comma;
    $vars["send_email"] .= $svars["work_email2"];
   }

    Thanks in advance.

~ Karthick
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to