Re: Replacing newlines (\n) with smething else

From: Date: Sun, 13 Jul 2003 22:11:35 +0000
Subject: Re: Replacing newlines (\n) with smething else
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-155026@lists.php.net to get a copy of this message
It's really strange because I type the following into the form field. Test Test Test And get this as output. Test Test Test Do form fields not preserve spacing or line breaks? Jason On Sun, 2003-07-13 at 17:45, David Otton wrote: > On 13 Jul 2003 17:27:04 -0400, you wrote: > > >Perhaps. When getting text from a form field, what is substituted for a > >newline (i.e. when someone hits enter). > > You can work it out for yourself. Run over the string, displaying each > character as it's ASCII equivalent with ord(). Eg > > for ($i = 0; $i < strlen($article); $i++) { > echo ("'" . $article[$i] . "'=" . ord($article[$i]) . > ', '); > } > > (My guess is that you're seeing the difference between a wrapped line and > the user explicitly hitting enter) >

« previous php.general (#155026) next »