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