Home >Backend Development >PHP Tutorial >PHP receives json passed by Android and converts it to array problem, androidjson_PHP tutorial
process: Android splices a json format data and passes the value, php receives and converts it to an array json_decode takes the value
The json format is: {"goods":{"100075":{"content":"Haha"},"53":{"content":"Really"},"50":{"content ":"Is it"}}}
Because Android passes toString and will escape the ""
{"goods":{"100075":{"content":"Haha"},"53":{"content":"Really"}," 50":{"content":"Is it"}}}
So php needs to be transferred back to htmlspecialchars_decode() so that the resulting json_decode will be no problem.
Remember json_decode($arr,true); the second parameter is true