In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use serialize and unserialize in php. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
In PHP, the serialize () function is used to serialize objects or arrays, and the unserialize () function is used to deserialize objects or arrays serialized by the serialize () function. The syntax is "serialize (object or array)" and "unserialize (string)".
Operating environment of this tutorial: windows10 system, PHP7.1 version, DELL G3 computer
What is the use of serialize and unserialize in php
The serialize () function serializes an object or array and returns a string.
After serializing the object, the serialize () function can easily pass it to other places where it is needed, and its type and structure will not change.
If you want to change the serialized string back to the value of PHP, use unserialize ().
The unserialize () function is used to deserialize the object or array serialized by the serialize () function and return the original object structure.
The syntax is as follows:
String serialize (mixed $value) mixed unserialize (string $str)
$value: the object or array to serialize.
Str: the serialized string.
Examples are as follows:
Output result:
ARanger 3: {iRAPR 0 Srig 6: "Google"; iRO 1 Tan Srig 6: "Runoob"; iRO 2 th Srig 8: "Facebook";}
Examples are as follows:
Output result:
Thank you for reading! This is the end of the article on "how to use serialize and unserialize in php". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.