Re: How to echo the "/n", "/r", etc... to the HTML display?

From: Date: Fri, 25 Jan 2002 18:33:25 +0000
Subject: Re: How to echo the "/n", "/r", etc... to the HTML display?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-82140@lists.php.net to get a copy of this message
I suppose "sp" is space? Two suggestions: Why don't you do <pre> (print here the string as-is. newlines and spaces will be kept as they are by the browser) </pre> Another Possibility: $string = preg_replace("/\\s/", "&nbsp;", $string); I hope I addressed your problem and didn't miss the point best regards Stefan Rusterholz ----- Original Message ----- From: "Scott Fletcher" <scott@abcoa.com> To: <php-general@lists.php.net> Sent: Friday, January 25, 2002 6:31 PM Subject: [PHP] How to echo the "/n", "/r", etc... to the HTML display? > Hi! > > I have been working on this part for a few days now! It had become > appareant that HTML is not able to do this, so I'm trying to get it to work > in PHP but no luck! The string I see like this is when I run the UNIX > command "od -av <filename> |more". > > --clip here-- > del cr lf cr lf cr lf cr > 0000020 lf P A G E sp 1 sp sp sp D A T E sp sp > 0000040 1 - 2 5 - 2 0 0 2 sp sp T I M E sp > 0000060 1 0 : 3 8 : 1 4 sp sp P @ F E P sp > 0000100 sp V 0 0 1 sp sp T C A 1 cr > --clip end-- > > So, you see, if I use the PHP function, nl2br(), that took care of the > "cr" and the "lf". But it doesn't take care of the "sp" so > how do I fix > that? This "sp" when work correctly will be able to justify the text on > each line. Anyone know? > > thanks, > Scott > > > > -- > 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 (#82140) next »