Atititphp serialize serialization and json serialization of php-attilaxAti

Source: Internet
Author: User
Atititphp serialization & #160; php serialize serialization and json serialization-attilaxAti Atitit php Serialization php serialize serialization and json serialization

PHP identifies different types of data with different letters. The Using Serialized PHP
Yahoo! All letters and meanings are given in Web Services:
A-array
B-boolean
D-double
I-integer
O-common object
R-reference
S-string
C-custom object
O-class
N-null
R-pointer reference
U-unicode string
N indicates NULL, while B, d, I, s

Author ::★(Attilax)> nickname: old Wow's Paw (full name: Attilax Akbar Al Rapanui Attila AKBA Arla Panui) Chinese name: Ai long, EMAIL: 1466519819@qq.com

Reprinted please indicate Source: http://www.cnblogs.com/attilax/

4. 1. serialization of arrays
Arrays are serialized as follows:
A: :{ ... }
Where Number of array elements, , ...... Array subscript, , 2> ...... The value of the array element corresponding to the subscript.
The following type can only be integer or string type. the serialized format is the same as that of the serialized data of integer and string type.
The value of an array element can be of any type, and its serialized format is the same as its serialized format.
4. 2. object serialization
Objects are serialized as follows:
O: :" ": :{ 2> ... }
Where Class name of the object The length of the string. The number of fields in the object. These fields
Including the fields declared with var, public, protected, and private in the class where the object is located and its ancestor class, but does not include static and
Static fields declared by const. That is to say, only the instance field is available.
, ...... Indicates the field name of each field, and ,
...... The field value corresponding to the field name.
The field name is string type, and the format after serialization is the same as that after serialization.
The field value can be of any type, and its serialized format is the same as its serialized format.
However, the serialization of field names is related to their declared visibility. next we will focus on the serialization of field names.

PHP Serialization _ serialize _ detailed description of the format-low-profile walk-blog channel-CSDN.NET.html

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.