I'm not at all sure about this, there is in fact some guessing going on. But as far as I know, the newline character '\n' is in fact a character, just like 'a' or 'b', which just happens to be represented as the two characters \ and n.
Now here's the guessing part. When the php parser finds the \ and n characters together they are parsed as a newline. What you want is the php parser to not parse it as a newline, but just the two characters \ and n, so that that parsing can be done by the javascript instead when you pass it to your function.
Again, just guessing, but perhaps you could replace all '\n' with an escaped backslash, '\\n'. Something like this
PHP Code:
str_replace('\n', '\\n', $your_string);
Otherwise, perhaps someboy else can shed some light on this 
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
|