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