Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

text on one line...

General discussions related to php

Moderators: macek, egami, gesf

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???
User avatar
beertastic
New php-forum User
New php-forum User
 
Posts: 3
Joined: Thu Dec 19, 2002 9:40 am

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

How about this...

$string=preg_replace("\n","",$string);
sarah
New php-forum User
New php-forum User
 
Posts: 4
Joined: Fri Jan 10, 2003 8:11 am


Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.