Re: new line in forms?

From: Date: Sun, 11 Mar 2001 23:08:40 +0000
Subject: Re: new line in forms?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-43416@lists.php.net to get a copy of this message
> On Sunday 11 March 2001 14:37, Jens wrote: > > You have probably had this question a few times, but can anyone tell me how > > to detect "new line's" or breaks in form fealds from both PC and Mac. And > > then replacing the "new line" with a <br> so that I can use it for the web? > > $string = nl2br( $string ); nl2br() don't replace the newlines with a <br> they insert a <br> before the newline, therefor you need something like: $string = str_replace("\n", "<br>", $string); -- Henrik Hansen

« previous php.general (#43416) next »