Jump to content

Need some help with new lines and wordwrap


CSmith1128

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...