Board Logo

STR Data breaking table need help please
markh - 9/16/2010 at 06:04 PM

I have a table with a field called comments and it has data like this:

var TABLE_CONTENT = [["2009/05/20 13:48:00", "added: Sent email to MessageLabs.
Line Break in text
another line feed ", "10030798"],


I'm using PHP to pull the data from Oracle and I generate the TABLE_CONTENT that way. What can I do to make the table work with this kind of data?

htmlspecialchars doesn't fix it.

Any help would be awesome, thanks in advance.

Mark


markh - 9/17/2010 at 03:38 PM

I have a temporary fix, it looks like I had to do a simple str_replace("n","",$string); and str_replace("r","",$string); To get it to work, so new lines and carriage returns breaks the tables. Any way around this or do I have to remove them?

Thanks in advance,

Mark


markh - 9/17/2010 at 06:57 PM

OK It's fixed now,

instead of doing a str_replace("\r","",$string) I did a str_replace("\r","<br/>",$string) This maintaines the line breaks and carriage returns.

Hope this helps someone else


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/