Re: New-line characters
| From: | Jamie Watt | Date: | Fri, 05 Apr 2002 10:57:31 +0000 |
| Subject: | Re: New-line characters | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91682@lists.php.net to get a copy of this message | ||
You'de be better off using the built in nl2br() function
(http://www.php.net/manual/en/function.nl2br.php) it'll have the same effect
as a it'll insert a <br> tag everwhere a newline character occurs. Where 2
newline characters occur it will produce <br><br> which in your HTML will
break your text in the same way that a <p> tag would.
"James Stewart" <JStewart@jubilee2000uk.org> wrote in message
news:E7ACE637F3E5D211AFB50080C86DF8812826D3@j2000_nt_srv1.jubilee2000uk.org.
..
> Hi,
>
> I have a form for users of a system I am developing to add their
newsletters
> to a MySQL database through. I take their input and INSERT it straight
into
> the database after adding slashes.
>
> When I retrieve the information from the database I would like to replace
> double occurences of new-lines with a <p> tag. Can anyone tell me what
> regexp I should be searching for?
>
> cheers. James.
>