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

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

WBOY
Release: 2016-06-06 20:30:39
Original
1722 people have browsed it

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>
Copy after login
Copy after login

回复内容:

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>
Copy after login
Copy after login

一般用的是unserialize

反序列化:unserialize

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

Related labels:
php
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