Two more interesting questions about json_decode and zend unknown mark

Source: Internet
Author: User
Two more interesting questions: json_decode and zend unknown Mark 1. for details about json_decode & nbsp; and & nbsp; json_encode, save the array json_encode & nbsp; to the cookie & nbsp ;, use & nbsp; json_decode & nbsp; to convert to an object and use & nbsp; jso to solve two interesting problems: unknown json_decode and zend tags.
1. about json_decode and json_encode,
Save the json_encode array to the cookie,
Use json_decode to convert the data to an object during retrieval.
Only strings can be obtained once using json_decode
I tried json_decode ($ cook1) and got the object,
What is the situation of Shenma?

2. how to add a custom tag in zend studio 9 so that the editor does not receive a warning? Note: Do not close the warning prompt. I want to know how to add a custom tag so that the editor does not prompt unknown tags.


------ Solution --------------------
If it is an array before packaging, your return value of json_decode is obj. The second parameter is set to true. The return value is array.
If it is a string before packaging, your return value of json_decode is string.
When you perform the second json_decode check, the value of this string will be returned in json format if obj is a normal string.

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.