Home >Backend Development >PHP Tutorial >PHP如何将这种序列化数据转成数组?

PHP如何将这种序列化数据转成数组?

WBOY
WBOYOriginal
2016-06-06 20:30:391700browse

session数据存在数据库了,不知道怎么转成数组

<code>blesta_id|s:1:"3";ip|s:14:"120.202.21.195";blesta_company_id|s:1:"1";blesta_client_id|s:1:"2";
</code>

回复内容:

session数据存在数据库了,不知道怎么转成数组

<code>blesta_id|s:1:"3";ip|s:14:"120.202.21.195";blesta_company_id|s:1:"1";blesta_client_id|s:1:"2";
</code>

一般用的是unserialize

反序列化:unserialize

关于序列化有两个官方函数:serialize() 和 unserialize(),建议在开发中使用json替代序列化。

Statement:
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