Re: string formatting help
| From: | In�rcia Sensorial | Date: | Fri, 06 Jul 2001 18:36:28 +0000 |
| Subject: | Re: string formatting help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56547@lists.php.net to get a copy of this message | ||
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.
--
Julio Nobrega.
A hora está chegando:
http://sourceforge.net/projects/toca
"Chad Day" <cday@atpco.com> wrote in message
news:NFBBLNJBKLPPMKEJAKCOEEJNCHAA.cday@atpco.com...
> 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
>