Jump to content

Archived

This topic is now archived and is closed to further replies.

dizel247

Cant figure out how to remove characters

Recommended Posts

Hello,

I have a code that user selects using checkboxes email addresses and sends email. My problem with the code is that I always need to delete last _; from the end of the string, otherwise email gives error.

Code:

<?php
if ($cbox=$_POST['cbox']){
foreach ($cbox as $key => $eemail )
echo "$eemail; ";
}
?>

Result I get:
a@aol.com; b@aol.com; c@aol.com;

Result I need is:
a@aol.com; b@aol.com; c@aol.com
(;_)<<<<< this needs to be removed.

How can I implement a code that will do it automatically?

Thanks in advance,

Roman K

Share this post


Link to post
Share on other sites
Use implode() instead:
[a href=\"http://www.php.net/implode\" target=\"_blank\"]http://www.php.net/implode[/a]

[code]implode('; ', $_POST['cbox']);[/code]

Share this post


Link to post
Share on other sites
[!--quoteo(post=381996:date=Jun 9 2006, 02:48 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 9 2006, 02:48 PM) [snapback]381996[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Use implode() instead:
[a href=\"http://www.php.net/implode\" target=\"_blank\"]http://www.php.net/implode[/a]

[code]implode('; ', $_POST['cbox']);[/code]
[/quote]


wow,

thanks for a quick reply. That did a trick.

Roman

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.