monkeytooth Posted September 4, 2008 Share Posted September 4, 2008 Ok I have a simple form to mail myself data that is posted by my users. I have that working fine, outputs to HTML formated mail.. All is good pretty much with it and working except 2 fields. 2 textarea's (multiline fields).. the output on them gets broken a bit, so my question is how do I catch the string prior to output and have it check to see if enter, return, or whatever have you is keyed.. in otherwords what I want to do is if the user keys in for a line break or 2 or 3 even I want to catch the line breaks and have it put <br> to simulate the break in the email as it would if i sent it to another form field similar.. Link to comment https://forums.phpfreaks.com/topic/122789-solved-strings-and-replacements/ Share on other sites More sharing options...
corbin Posted September 4, 2008 Share Posted September 4, 2008 Errrrr..... I think you're looking for http://php.net/nl2br. Link to comment https://forums.phpfreaks.com/topic/122789-solved-strings-and-replacements/#findComment-634041 Share on other sites More sharing options...
monkeytooth Posted September 4, 2008 Author Share Posted September 4, 2008 That did the trick.. thank you. Back in earlie PHP 4 when i used to do similar i would use ereg_replace or str_replace.. and that worked.. but it doesnt anymore not for me atleast in this notion.. but yea, thanks again.. Link to comment https://forums.phpfreaks.com/topic/122789-solved-strings-and-replacements/#findComment-634049 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.