dizel247 Posted June 9, 2006 Share Posted June 9, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/11599-cant-figure-out-how-to-remove-characters/ Share on other sites More sharing options...
poirot Posted June 9, 2006 Share Posted June 9, 2006 Use implode() instead:[a href=\"http://www.php.net/implode\" target=\"_blank\"]http://www.php.net/implode[/a][code]implode('; ', $_POST['cbox']);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/11599-cant-figure-out-how-to-remove-characters/#findComment-43780 Share on other sites More sharing options...
dizel247 Posted June 9, 2006 Author Share Posted June 9, 2006 [!--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 Quote Link to comment https://forums.phpfreaks.com/topic/11599-cant-figure-out-how-to-remove-characters/#findComment-43795 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.