Preserved Topic: auto inserting P tags in PHP |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 07-18-2001 18:23
I have a form that lets me insert data into a MySQL table. However, I have one field that is an article body. I toss all the text into the form field, with carriage returns for the paragraphs. When it gets enterered into the database, and, subsequently displayed in HTML, I don't have any spaces between the paragraphs (no big surprise). Is there a way (in PHP) to automatically change carriage returns to <p> tags or something similar? |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 07-18-2001 18:29
nl2br() is your friend. |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 07-18-2001 18:52
Yes it is! |