I\'m having a strange problem when retrieving JSON formatted text. I use jQuery post to send some data (also JSON formatted) to the server (running PHP) which w
Line breaks aren't the issue so much as they need to be properly escaped in JSON. If it's available to you, you can use json_encode which automatically escapes newlines. Failing that, you can use something like Pim Jager's method above, though a proper JSON encoder would be best.