![]() Preserved Topic: auto inserting P tags in PHP (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() 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 |
![]() nl2br() is your friend. |
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() Yes it is! |