Re: newline to <p>?
| From: | Mulga Web Services | Date: | Tue, 29 Aug 2000 09:17:40 +0000 |
| Subject: | Re: newline to <p>? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14075@lists.php.net to get a copy of this message | ||
I'm fairly new to PHP and others may correct me or provide better solutions,
but here's what I'd try:
$variable = ereg_replace("\n \n","<P>",$variable);
If that doesn't work, play around with the first argument until it does work
(for example, try "\n\n")
Mulga Mick
----- Original Message -----
From: <miryadi@indo.net.id>
To: <php-general@lists.php.net>
Sent: Tuesday, August 29, 2000 5:43 PM
Subject: [PHP] newline to <p>?
> does anybody knows how to write a php script that convert two
> consecutive newlines into <p>, similar to nl2br function.