pickachu Posted September 26, 2008 Share Posted September 26, 2008 hi, how do i change every newline in my textarea at turn it into paragraph example: <textarea name="txt"> Frist paragraph Second Paragraph Third Paragraph </textarea> im trying to find an alternative to nl2br function Link to comment https://forums.phpfreaks.com/topic/126007-newline-into-p/ Share on other sites More sharing options...
discomatt Posted September 26, 2008 Share Posted September 26, 2008 http://www.phpfreaks.com/forums/index.php/topic,218477.0.html But i don't think HTML is parsed in <textarea> tags. Link to comment https://forums.phpfreaks.com/topic/126007-newline-into-p/#findComment-651622 Share on other sites More sharing options...
corbin Posted September 27, 2008 Share Posted September 27, 2008 Weird.... Homework assignment or something? Link to comment https://forums.phpfreaks.com/topic/126007-newline-into-p/#findComment-651624 Share on other sites More sharing options...
jcbarr Posted September 27, 2008 Share Posted September 27, 2008 Yeah nl2br is normally good enough due to the fact that most people will actually hit return twice when they mean to start a new paragraph. Link to comment https://forums.phpfreaks.com/topic/126007-newline-into-p/#findComment-651626 Share on other sites More sharing options...
xtopolis Posted September 27, 2008 Share Posted September 27, 2008 you could replace the line breaks (\r \n) using preg_replace possibly.. but you'd have to accommodate the line beginning's as well to make the tags match.. Link to comment https://forums.phpfreaks.com/topic/126007-newline-into-p/#findComment-651651 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.