Search code examples
phpmysqlhtmlnl2br

NL2BR() PHP problem help please?


So on my website you are able to send messages. I use the nl2br() function so if someone presses enter, their text will have linebreaks. I realized though, if the person typing the text doesn't press enter and is instead wrapped by the textarea, the text is still broken. How can I avoid this? (How can I avoid linebreaks if the user doesn't press enter)


Solution

  • I found the answer:

    I had wrap="hard" so when I changed it to wrap="soft" the user had to press enter to add linebreaks. Thanks for everyone's help.