xyn Posted July 19, 2006 Share Posted July 19, 2006 Hi,I wanted to insert some things into my database so the linebeaks do not get removed.basically to send a private message and When I input:[sup]Hi,How are you?ps. test[/sup]it looks like:[sup]Hi, How are you? p.s test[/sup]Does anyone know what I can do? Link to comment https://forums.phpfreaks.com/topic/15052-detecting-line-breaks/ Share on other sites More sharing options...
akitchin Posted July 19, 2006 Share Posted July 19, 2006 when you're echoing it from the database, use nl2br(). Link to comment https://forums.phpfreaks.com/topic/15052-detecting-line-breaks/#findComment-60546 Share on other sites More sharing options...
xyn Posted July 19, 2006 Author Share Posted July 19, 2006 Thanks, would that be:[code=php:0]<?PHPecho 'nl2br(CODE HERE)';[/code] Link to comment https://forums.phpfreaks.com/topic/15052-detecting-line-breaks/#findComment-60548 Share on other sites More sharing options...
akitchin Posted July 19, 2006 Share Posted July 19, 2006 [code]echo nl2br($variable_containing_the_post);[/code] Link to comment https://forums.phpfreaks.com/topic/15052-detecting-line-breaks/#findComment-60549 Share on other sites More sharing options...
xyn Posted July 19, 2006 Author Share Posted July 19, 2006 oh yes :P thank you Link to comment https://forums.phpfreaks.com/topic/15052-detecting-line-breaks/#findComment-60550 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.