Allan- Posted August 13, 2008 Share Posted August 13, 2008 Hi, my question is: how to remove linebreaks (not <br />-s) which i made pressing enter in <textarea>. Hopefully there is such php function. Quote Link to comment Share on other sites More sharing options...
efficacious Posted August 13, 2008 Share Posted August 13, 2008 i think we need more information on what your doing to help.. most of the time unless you use a function it already gets rid of line breaks by default. as far as I kno ne ways Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 13, 2008 Share Posted August 13, 2008 Umm... $text = str_replace("\n", '', $text); Quote Link to comment Share on other sites More sharing options...
efficacious Posted August 13, 2008 Share Posted August 13, 2008 does textareas hold line breaks dark? Quote Link to comment Share on other sites More sharing options...
trq Posted August 13, 2008 Share Posted August 13, 2008 does textareas hold line breaks dark? Yes. Quote Link to comment Share on other sites More sharing options...
thebadbad Posted August 13, 2008 Share Posted August 13, 2008 If you want to remove all line breaks from a string, remove "\r" and "\n" (depending on OS, "\r\n" and "\n" are line breaks): <?php $text = str_replace("\n", '', str_replace("\r", '', $text)); ?> Quote Link to comment Share on other sites More sharing options...
Allan- Posted August 13, 2008 Author Share Posted August 13, 2008 thanks! i got all what i needed. Quote Link to comment 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.