I have a jquery ajax which invokes a php file which outputs a json object.
It all works great on versions of php higher than 5.3, but lower versions don't have JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, and JSON_UNESCAPED_UNICODE implemented yet.
How do I escape "json sensitive" chars like "&" or "=" in earlier versions?
Thank you for your time!
EDIT:
scratch that.. the problem is =>
i have <br /> in the text and that gets changed to <br \="">
the " gives the error...
&and=are treated as normal characters in JSON, you're probably thinking of URLs.json_decode(json_encode('<br />')) === '<br />'— So what exactly are you doing?