Jump to content

Cant figure out how to remove characters


dizel247

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
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.