CSmith1128 Posted September 25, 2007 Share Posted September 25, 2007 Ok.. so heres my problem. I have a place where users can post comments on my site. I want these comments to accept and display any new lines they enter ("\n") into the text box, and i want the output to be wordwrapped.. i have it working, however, it displays weird and I want to know if it is fixible. Or, is it better to use another form of wordwrap?heres the code i have... $comment = nl2br(stripslashes(htmlspecialchars($getComment_Query['comment'])));$comment = wordwrap(ereg_replace("<br />", "<br>", $comment), 50, "<br>", TRUE); heres the output.. this is a sample comment that I am leaving. thisis a sample comment that I am leaving.thats how it appears on my page and it looks pretty ugly..anyone have any ideas? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 25, 2007 Share Posted September 25, 2007 Use wordwrap before nl2br, have wordwrap use normal line breaks and then use nl2br to convert the result of that into HTML breaks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.