DeanWhitehouse Posted November 20, 2008 Share Posted November 20, 2008 nl2br(); Is it possible for it to produce <br> instead of <br/> . Link to comment https://forums.phpfreaks.com/topic/133555-solved-nl2br-break-line-without-self-closing-tag/ Share on other sites More sharing options...
marcus Posted November 20, 2008 Share Posted November 20, 2008 echo nl2br($input,false); if that method fails for you $l = str_replace("\r\n","<br>",$line); Link to comment https://forums.phpfreaks.com/topic/133555-solved-nl2br-break-line-without-self-closing-tag/#findComment-694679 Share on other sites More sharing options...
DeanWhitehouse Posted November 20, 2008 Author Share Posted November 20, 2008 The first wouln't work because there is only one argument for nl2br, but the str_replace one works fine. Link to comment https://forums.phpfreaks.com/topic/133555-solved-nl2br-break-line-without-self-closing-tag/#findComment-694696 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.