How to convert json to array transmitted by Android in php? androidjson_PHP tutorial

Source: Internet
Author: User
Tags convert json to array
Android. Php receives the json-to-array format transmitted by Android. androidjson process: Android concatenates a json-format data transfer value. The json format of the json_decode value received by php is as follows: android json to array received by php.

Process: Android concatenates a data transfer value in json format, and converts the value of json_decode to an array in php.

Json format: {"goods": {"100075": {"content": "Haha"}, "53": {"content": "true "}, "50": {"content": "Is It "}}}

Because Android uses toString to escape "",

{"Goods": {"100075": {"content": "Haha"}, "53": {"content": "true"}, "50 ": {"content": "not "}}}

Therefore, php needs to be transferred back to htmlspecialchars_decode (), so that the json_decode is no problem.

Remember json_decode ($ arr, true); the second parameter is true.

Http://www.bkjia.com/PHPjc/1130482.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1130482.htmlTechArticlephp received Android passed json to the array problem, androidjson process: Android stitching a json format of data transfer value, php received into the array json_decode value json format :...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.