PHP Serialization and deserialization

Source: Internet
Author: User

PHP serialization simply means compressing a complex data type into a string in which the PHP object is converted to a string, and deserialization is the conversion of the variable into an object.

In general, when you place these serialized data in a URL and pass between pages, you need to call UrlEncode () on the data to ensure that the URL metacharacters are processed

More often, we will try to make an array stored in an array with serialization, compared to the need to store multiple fields, more practical

  $arr = Array (' AC ', ' AC ', ' ad ', ' BB ');

  $ser = serialize ($arr);//serialization

  $ser = Unserialize ($ser);//deserialization

PHP Serialization and deserialization

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.