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/", " ", $string);
I hope I addressed your problem and didn't miss the point
best regards
Stefan Rusterholz
----- Original Message -----
From: "Scott Fletcher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]