Differentiate Line breaks and Paragraphs
| From: | Simon Dániel | Date: | Fri, 02 Nov 2012 19:32:00 +0000 |
| Subject: | Differentiate Line breaks and Paragraphs | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-319652@lists.php.net to get a copy of this message | ||
Hi,
Is there a way to make difference between line breaks and paragraphs, when
I save a text to a database from a user input? The new line characters (\n,
\r) are not too consequent to determine when did the user only one new line
or more new lines. (Some clients make only \n or \r, some others make \n\r
or \r\n, etc.)
What I would like to do is, to format the given text into paragraphs (with
<p> tag), not just insert a batch of break line (<br />) tags.
Of course, I want to retain <br /> tags as well, in case of the user wrote
only one new line character.