[thelist] replacing CRLFs in Memo fields

Burhan Khalid thelist at meidomus.com
Tue Mar 15 06:28:07 CST 2005


Pringle, Ron wrote:
> Ok, two more related questions. I've googled around for this and haven't
> come across anything. (any links would be appreciated).
> 
> In my Access 2000 DB I have a memo field that will be taking input from a
> web form. The people using the form will most likely be cutting and pasting
> text from MS Word docs.
> 
> That memo field will in turn be displayed on the web. I want to preserve the
> paragraph formatting of the original text.
> 
> 1. How do I go about finding and replacing the CLRFs that are inserted in
> the form field with <p> tags?

If you are using PHP, you can use the nl2br() function which will do 
this for you (and you can preserve the original format in the database).

As its name suggests, it converts newlines to break tags.

Hope this helps


More information about the thelist mailing list