Atitit php serialization php serialize serialization and json serialization

WBOY
Release: 2016-07-29 08:51:30
Original
939 people have browsed it

Atitit phpserializationphp’s serializeserialization and jsonserialization

PHP for different types The data is marked with different letters. The article Yahoo provides Using Serialized PHP withYahoo! Web Services provides all the letter markings and their meanings: a - array b - booleand - doublei - integero - common objectr - references - stringC - custom objectO - classN - nullR - pointer referenceU - unicode stringN means NULL, and b, d, i, s

Author::★(attilax)>>> nickname:老Wow’s Claw(Full name:: Attilax Akbar Al Rapanui AttilaxAkbarAlRapa Nui)Chinese name: Ailong, EMAIL:1466519819@qq. com

Please indicate the source for reprinting: http://www.cnblogs.com/attilax/

4.1. Serialization of arrays Arrays (array) are usually serialized as: a::{}where represents the number of array elements, , … … represents the array subscript, , 2>… represents the array element corresponding to the subscript value. The subscript type can only be integer or string. The format after serialization is the same as the format after serialization of integer and string data. The array element value can be of any type, and its serialized format is the same as the serialized format of its corresponding type. 4.2. Serialization of objects Objects (object) are usually serialized as: O::""::{ 2>...}where represents the class of the object The string length of name . represents the number of fields 1 in the object. These fields include fields declared with var, public, protected and private in the object’s class and its ancestor classes, but do not include static and const static fields declared. That is to say, there are only instance (instance) fields. , ... represents the field name of each field, while , …… represents the field value corresponding to the field name. The field name is of string type, and the format after serialization is the same as the format after serialization of string data. The field value can be of any type, and its serialized format is the same as the serialized format of its corresponding type. But the serialization of field names is related to their declared visibility. Let’s focus on the serialization of field names below.

PHPSerialization_serialize_Detailed format explanation - Walk quietly - Blog channel - CSDN.NET.html

The above introduces Atitit php serialization, PHP's serialize serialization and json serialization, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template