Re: [PHP4BETA] Error: " " is not added

From: Date: Wed, 05 Apr 2000 15:43:33 +0000
Subject: Re: [PHP4BETA] Error: " " is not added
Groups: php.version4 
Request: Send a blank email to php-version4+get-13170@lists.php.net to get a copy of this message
On Wed, 5 Apr 2000 15:53:31 +0200 (CEST), ZioBudda <michel@michel.enter.it> wrote: > > Hi, I have send it to the 2 lists because I don't know if it is my error > in the scripts or a bug in PHP4RC1. > > I have this little code: > $cognome_linea = trim($cognome_linea); > while(strlen($cognome_linea)< 70); > { $cognome_linea .= " "; > print("cog = --$cognome_linea--<BR>"); > } > print("cog = --$cognome_linea--<BR>"); > > The enter in a loop beacuse > $cognome_linea .= " "; > not working. If I make > > $cognome_linea = "foo" > $cognome_linea .= " "; > > the result is > cog = --foo-- > > Why this? > Where is my error, if one? > Check the string length of $cognome_linea, you'll probably find that it does have all those spaces but the browser is not displaying them. Try using: $cognome_linea.="&nbsp;"; instead of $cognome_linea.=" " or <pre> tags print("cog = <pre>--<pre>$cognome_linea--</pre><BR>"); Regards, Alan van den Bosch Sanguis Pty Ltd /* All generalizations are false. */

« previous php.version4 (#13170) next »