I\'m generating a string in PHP and then eventually passing this string into a JavaScript alert box, my problem is I actually can\'t add line breaks in my alert box.
My c
This happens because PHP interprets the \n before JavaScript has the chance to, resulting in a real line break inside the Javascript code. Try
\\n