RE: [PHP] newline to <p>?

From: Date: Tue, 29 Aug 2000 10:12:12 +0000
Subject: RE: [PHP] newline to <p>?
Groups: php.general 
Request: Send a blank email to php-general+get-14088@lists.php.net to get a copy of this message
try this: $newLine =' '; $variable = ereg_replace($newLine,"<P>",$variable); This worked once for me. Cheers -----Original Message----- From: miryadi@indo.net.id [mailto:miryadi@indo.net.id] Sent: Tuesday, August 29, 2000 6:46 PM To: php-general@lists.php.net Subject: Re: [PHP] newline to <p>? 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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#14088) next »