Jump to content

Removing hidden "\n" or "\r"


sanfly

Recommended Posts

Hi,

 

I have addresses stored in a mysql database in a text field, so they look like this

 

Joe Bloggs

2345 Pleasant Road

Auckland

New Zealand

 

However, I need to put these addresses into javascript, and javascript doesnt like things going over two lines.  I want to remove the "hidden" carriage returns/new line codes that make it display over mulitple lines when I extract from the database, but I can seem to figure out how to do it.  Have tried a million different permuations using str_replace.  Can anyone suggest how they would do it?

 

 

Link to comment
https://forums.phpfreaks.com/topic/38834-removing-hidden-n-or-r/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.