[eluser]richzilla[/eluser]
Hi all,
Im having trouble with line breaks messing up my javascript with unterminated string errors. The string in question is being pulled directly from the database and echo'd into my Javascript with php. Is there any way to echo line breaks out as "\n" instead of them being interpreted as line breaks?
[eluser]Prophet[/eluser]
If you are using double quotes in the echo, PHP will just throw out a line break. Use single quotes and it will print '\n'. You could also try using the HTML character code for \
[eluser]Prophet[/eluser]
Great that you got it to work
Always remember that when a string is enclosed in double quotes, PHP will interpret special characters and variables. With single quotes, it just takes what you give it and doesn't interpret anything.