PHP receives json passed by Android and converts it to array problem, androidjson_PHP tutorial

WBOY
Release: 2016-07-12 08:51:24
Original
1144 people have browsed it

php receives the json passed by Android and converts it to an array. Problem, androidjson

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1130482.htmlTechArticlephp receives the json passed by Android and converts it into an array problem, androidjson process: Android splices a json format data to pass the value, php Receive and convert it into an array json_decode. The value json format is:...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!