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:[email protected]; [email protected]; [email protected]; Result I need is:[email protected]; [email protected]; [email protected](;_)<<<<< this needs to be removed. How can I implement a code that will do it automatically? Thanks in advance, Roman K 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] 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 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
Archived
This topic is now archived and is closed to further replies.