immanuelx2 Posted June 28, 2009 Share Posted June 28, 2009 Hey guys, I have a form that is being processed via $_POST variables and was wondering if there is a regexp way of removing a newline char (\n) if it is the very last thing that was inside a textarea. Also, any idea why this isn't working? <?php $comment = str_replace("[/quote]\n","[/quote]",$comment); ?> Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/163987-solved-removing-n-if-it-is-the-last-thing-in-a-text-area/ Share on other sites More sharing options...
dzelenika Posted June 28, 2009 Share Posted June 28, 2009 what about trim() Link to comment https://forums.phpfreaks.com/topic/163987-solved-removing-n-if-it-is-the-last-thing-in-a-text-area/#findComment-865170 Share on other sites More sharing options...
immanuelx2 Posted June 29, 2009 Author Share Posted June 29, 2009 what about trim() what a great idea!!! Link to comment https://forums.phpfreaks.com/topic/163987-solved-removing-n-if-it-is-the-last-thing-in-a-text-area/#findComment-865317 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.