解码JSON字符串时偶尔会出错

I have two different servers.

In the first one, my development server, everything works as they should. On the second one, my production server, I get a couple of errors I don't know how to address.

On the latter, I keep getting an error while json_decode'ing a string. When trying to pinpoint the error, I found the below:

On my development server, when I var_dump the POST data, I get:

'data' =>
    string(96) "{"id":null,"codigo":55,"nome":"testa","coordenador":"testa","financiadora":"testa","ativo":true}"

Whereas on my production server, I get:

["data"]=>
    string(113) "{\"id\":null,\"codigo\":4,\"nome\":\"teste\",\"coordenador\":\"teste\",\"financiadora\":\"teste\",\"ativo\":true}"

}

I could probably strip the backslashes in my production server, but I don't want to have two different codes. I also don't understand why it's happening.

Is it an Apache/PHP configuration issue? How do I address that?

Exact same code, exact same database in both servers.

Sounds like your production server has Magic Quotes enabled. Turn it off and the problem should disappear.