PHPjson_decode function parsing _ PHP Tutorial

Source: Internet
Author: User
The PHPjson_decode function is parsed in detail. I. function introduction 1. this function has four parameters. Generally, the first two parameters are used. for specific parameters, see the manual. 2. the first parameter is a string in json format, and the second parameter I. INTRODUCTION to functions
1. this function has four parameters. Generally, the first two parameters are used. for specific parameters, see the manual.

2. the first parameter is a string in json format, and the second parameter is a boolean value (false is converted to an object, true is converted to an array, and false by default). if the conversion fails, null is returned.

II. problems encountered
A java-written web service is called in the project. the returned data is "{'stauts': '1', 'message': 'Recharged successfully '}".

After receiving the code, the program converts the result to an array using json_decode, but the result of conversion is null, which is strange.

I read the manual and found the following instructions in the manual.


Change the returned result to '{"stauts": "1", "message": "recharge successful"}' and convert the array.

Limit 1. this function has four parameters. Generally, the first two parameters are used. for specific parameters, see the manual. 2. the first parameter is a json string, and the second parameter...

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.