如何将序列化的数据从SQL数据库转换为对象或json?

时间:2019-04-18 18:50:23

标签: javascript serialization

我正在尝试使用以下形式的数据集:

a:15:{s:12:"cfdb7_status";s:6:"unread";s:10:"first- 
name";s:6:"test";s:9:"last-name";s:5:"test";s:10:"your- 
email";s:24:"test";s:3:"age";s:8:"Under 18";s:6:"gender";a:1: 
{i:0;s:4:"Male";}s:7:"country";s:24:"test";s:10:"get-packet";a:1: 
{i:0;s:68:"I would like to receive parcel by mail.";}s:16:"test";s:1:"1";s:7:"address";s:18:"test";s:4:"city";s:9:" 
test";s:5:"state";s:10:"test";s:3:"zip";s:5:"test";s:13:"resource-type";s:5:"Other";s:17:"regarding-my-life";a:1:{i:0;s:35:"test";}}

JSON.parse引发错误。是否存在可以将该数据反序列化为对象的库?

0 个答案:

没有答案