I\'ve read several posts about the question and found this to be the simplest solution, here is my code:
js inside PHP code
Pretty sure that won't break it. The whole point of json_encode is that it's safe to dump.
json_encode
might break it, but PHP escapes / as \/ by default so you shouldn't have to worry about it.
/
\/