Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting actual line breaks.

Status
Not open for further replies.

overyde

Programmer
May 27, 2003
226
ZA
Hi,
I have some data that needs to passed into a javascript from mysql through php. The javascript however is line sensitive i.e. data can not go on new line. ie:
Needs to be like this:
Code:
myScroller1.addItem("<b>Overyde:</b>Hello my name is overyde");

not

myScroller1.addItem("<b>Overyde:</b>Hello
my name is overyde");
So i need something that will place the data into one line.
Is this possible?

Reality is built on a foundation of dreams.
 
No worries...
Sorted it out!

Code:
str_replace("\r\n","<br>",$data);

Reality is built on a foundation of dreams.
 
nl2br(); doesn't actually syop physical "carriage returns/new lines" which break up my javascript.

Reality is built on a foundation of dreams.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top