Re: newline to <p>?

From: Date: Tue, 29 Aug 2000 09:46:15 +0000
Subject: Re: newline to <p>?
Groups: php.general 
Request: Send a blank email to php-general+get-14082@lists.php.net to get a copy of this message
thanks for your reply, i've tried $variable = ereg_replace("\n \n","<P>",$variable); and $variable = ereg_replace("\n\n","<P>",$variable); but it doesn't work :( if someone can give me a clue what does nl2br function do, (the code of nl2br) maybe i can solve my problem. >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.

« previous php.general (#14082) next »