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...