Home > php教程 > php手册 > php的序列化和反序列化有什么好处?

php的序列化和反序列化有什么好处?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:38:15
Original
1486 people have browsed it

问题:

PHP序列化serialize ,手册中说可以把一个数组或对象转化成一个字符串,方便传输和存储,
但不知什么时候用,什么时候不用好呢?
比如说我要做一个新闻系统,里面有标题,作者,内容,发表时间,等很多的字段,在传输时我都把
它序列化成一个字符串,存在数据库中,这样的话,数据库中就不用建很多的字段了
用的时候再反序列化出来,这样做的话,比不序列化,建很多字段存储好吗?

回答:

可以把一个数组或对象转化成一个字符串,方便传输和存储。

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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template