NYCPHP Meetup

NYPHP.org

[nycphp-talk] Textarea formatting

Ken Robinson kenrbnsn at rbnsn.com
Thu Oct 19 13:23:47 EDT 2006


At 12:47 PM 10/19/2006, Ben Sgro (sk) wrote:
>Hello all,
>
>I have a textarea field that can .. store text.
>
>I'm using it to save emails for example w/a form.
>I grab the posted data and call addslashes( ) then stick it into the
>database, varchar(1024). (this is a calendar app for my own use).
>
>Now, when I pull it out, its not formatted and displaying it on the screen
>is just one long line.
>
>How can I keep newlines/r and formatting from the text that is input into
>the textarea box?

Use the nl2br() function when displaying the data.

Ken 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20061019/6ba018a9/attachment.html>


More information about the talk mailing list