URL encoding seems to get in the way of properly json encoding/decoding in my PHP program URL encoding seems to get in the way of properly json encoding/decoding in my PHP program json json

URL encoding seems to get in the way of properly json encoding/decoding in my PHP program


It sounds like you have magic quotes enabled (which is a big no-no). I would suggest you disable this, otherwise, run all your input through stripslashes().

However, it is better practice to reference the POST data as a key/value pair, otherwise you will have to read the php://input stream.


For the quick fix, try:

$report = stripslashes($_POST['report']);

Better, disable magic quotes GPC. G=Get, P=Post, C=Cookie.

In your case Post. Post values get automatically ("magic") quoted with a single slash.

Read here how to disable magic quotes.