Adam W Posted May 25, 2007 Share Posted May 25, 2007 I use a textarea to capture input text for an e-mail. When ever a user enters a £ sign the e-mail generated contains the HTML code £ which is correct for a web page but how do I convert this to a £ for inclusion in a plain text e-mail, I thought html_entity_decode() would provide the correct functionality but it does not seem to when used like this $body = $_POST[Message]; $body = html_entity_decode($body); Thanks for any help Quote Link to comment https://forums.phpfreaks.com/topic/53006-solved-%C2%A3-signs/ Share on other sites More sharing options...
corbin Posted May 25, 2007 Share Posted May 25, 2007 Make sure the email is in UTF-8 or something similar and it should work just fine as plain text.... How to get it back to plain text, I have no idea.... You could str_replace all the & codes...... Quote Link to comment https://forums.phpfreaks.com/topic/53006-solved-%C2%A3-signs/#findComment-261856 Share on other sites More sharing options...
Adam W Posted May 25, 2007 Author Share Posted May 25, 2007 You could str_replace all the & codes...... I was rather hoping that I wouldn't have too! Quote Link to comment https://forums.phpfreaks.com/topic/53006-solved-%C2%A3-signs/#findComment-261862 Share on other sites More sharing options...
per1os Posted May 26, 2007 Share Posted May 26, 2007 <?php $string = "1,600£"; echo "before: " . $string . "<br />" $string = str_replace("£", "£", $string); echo "after: " . $string . "<br />"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/53006-solved-%C2%A3-signs/#findComment-261869 Share on other sites More sharing options...
Adam W Posted May 26, 2007 Author Share Posted May 26, 2007 Thanks very much works a treat! Quote Link to comment https://forums.phpfreaks.com/topic/53006-solved-%C2%A3-signs/#findComment-262105 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.