Possible duplicate:
Why escape characters are added to hidden input value
So, I have a Save.php file.
Two things are required: a file and new content.
You use it by sending a request, such as '/Resources/Save.php?file=/Resources/Data.json&contents={"Hey":"There"}' .
.. but of course url coding. :) I left everything unencoded for simplicity and readability.
The file works, but instead of the content.
{"Hey":"There"}
.. I find ..
{\"Hey\":\"There\"}
.. which, of course, throws an error when trying to use JSON.parse when receiving a JSON file later through XHR.
To save the contents, I just use ..
file_put_contents($url, $contents);
What can I do to get rid of backslashes?
Kayla source share