any other way ?

From: Date: Wed, 04 Apr 2001 16:25:14 +0000
Subject: any other way ?
Groups: php.general 
Request: Send a blank email to php-general+get-47092@lists.php.net to get a copy of this message
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: tvkarthick@myrealbox.com,,tvkarthick@yahooo.com (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 tvkarthick@myrealbox.com

« previous php.general (#47092) next »