Vs: [PHP] Newlines to <BR>

From: Date: Mon, 18 Sep 2000 17:41:11 +0000
Subject: Vs: [PHP] Newlines to <BR>
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-17190@lists.php.net to get a copy of this message
Hello, Try this: $string = str_replace("\n", "<br>", $string); There is also an own function for this action: nl2br($string); Cheers, - Ville ............................................. Ville Mattila Ikaalinen, Finland > Hello, people! > An easy task.... how do I convert in an string context new lines > (\n) to <br>'s? > I'd tried "strtr ($string, "\n", "<br>")" but it > didn't worked.... > > > -- > 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 (#17190) next »