text on one line...

General discussions related to php

Moderators: macek, egami, gesf

User avatar
beertastic
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Dec 19, 2002 9:40 am

text on one line...

Postby beertastic » Fri Jan 10, 2003 8:38 am

I have a string that I've pulled from a database, but I wanna put it in a javascript scroller thingy.
All well and good, but the string has line breaks in it, which screws up
the scroller
(see http://212.53.85.203 - and do a view source, it's the top few lines)

How can I force that info onto one line? so that the JavaScript will
work???

sarah
New php-forum User
New php-forum User
Posts: 4
Joined: Fri Jan 10, 2003 8:11 am

Postby sarah » Fri Jan 10, 2003 10:07 am

How about this...

$string=preg_replace("\n","",$string);


Return to “PHP General”

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest