Yeah, I was seeing them.  And when I stripped them out and replaced them
with white space, it still broke in those places, it'd look like:

kdjsakdasja

dsakjaskjsa


dsakaskj

But I got it fixed..

                        $RESPONSE = addslashes($row[RESPONSE]);
                        $OVERLIBBED = str_replace(chr(13), "", $RESPONSE);
                        $OVERLIBBED = str_replace(chr(10), "", $OVERLIBBED);

is what worked for me ..

Thanks all,
Chad

-----Original Message-----
From: Steve Edberg [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 4:29 PM
To: Chad Day; [EMAIL PROTECTED]
Subject: [PHP] Re: string formatting help


In the original message below, did you mean that you're actually
SEEING the <br> tags in the output? If so, there may be a conversion
with htmlentities() going on somewhere that converts the <br> tags to
&lt;br&gt; (so they are displayed instead of being interpreted).

If you replaced the <br>'s with spaces or newlines, the output
_should_ all be on one line, since HTML considers ALL strings of
whitespace (tabs, newlines, returns, spaces) to be a single space. If
you replaced <br>'s with newlines and you are getting the line breaks
still, your output may be in a <pre>...</pre> block.

        - steve


At 3:36 PM -0300 7/6/01, "InÈrcia Sensorial" <[EMAIL PROTECTED]> wrote:
>   Maybe:
>
>$array = explode("<br>", $string);
>
>foreach ($array as $key => $value) {
>     echo "$value";
>}
>
>   Would separate the string by <br>'s and print all in one line.
>


Or, more compactly:

        echo str_replace('<br>', '', $string);

This would only work if tags were lowercased; to handle mixed case,
you'd need to do

        echo eregi_replace('<br>', '', $string);

or use the preg equivalent




>   Julio Nobrega.
>
>A hora est· chegando:
>http://sourceforge.net/projects/toca
>
>"Chad Day" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>  I'm trying to pull a string from a database to use in a javascript
>>  function.. but it's doing line breaks on me, which in turn messes up the
>>  javascript.
>>
>>  The string in the mysql db is like:
>>  kjdsakjadk<br>skjdks<br><br>kjkdfjdfkjfd
>>
>>  When I pull it out, it becomes:
>>
>>  kjdsakjadk
>>  <br>
>>  skjdks
>>  <br>
>>  <br>
>>  kjkdfjdfkjfd
>>
>>  I've tried replacing the br's with blank spaces or new line characters,
>but
>>  in the html code it still breaks on those breaks when I echo it back
out.
>>  How can I force this string to be all on one line?
>>
>>  Thanks,
>  > Chad
>>

--
+------ Factoid: Of the 100 largest economies in the world, 51 are ------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                               Computer Consultant |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+--- corporations ------ http://www.ips-dc.org/reports/top200text.htm ---+

--
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]

Reply via email to