Jump to content

Need some help with new lines and wordwrap


CSmith1128
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...