【问题标题】:Weird looking "json" code - how can I convert it to php/array/json?看起来很奇怪的“json”代码 - 我怎样才能将它转换为 php/array/json?
【发布时间】:2020-08-20 20:33:15
【问题描述】:

我有这个数据代码,我需要 PHP 数组/对象格式的数据,有人认识这个吗?

它看起来像 json,但它不是。我已经从 WordPress 数据库中提取了它

a:3:{i:0;a:10:{s:17:"availability_type";s:6:"custom";s:9:"from_date";s:16:"2020-05-14 18:00";s:13:"from_week_day";s:1:"1";s:10:"from_month";s:1:"1";s:9:"from_time";s:0:"";s:11:"to_week_day";s:1:"1";s:8:"to_month";s:1:"1";s:7:"to_date";s:16:"2020-05-14 18:00";s:7:"to_time";s:0:"";s:10:"is_bokable";s:3:"yes";}i:1;a:10:{s:17:"availability_type";s:6:"custom";s:9:"from_date";s:11:"2020-05-15 ";s:13:"from_week_day";s:1:"1";s:10:"from_month";s:1:"1";s:9:"from_time";s:0:"";s:11:"to_week_day";s:1:"1";s:8:"to_month";s:1:"1";s:7:"to_date";s:11:"2020-05-15 ";s:7:"to_time";s:0:"";s:10:"is_bokable";s:3:"yes";}i:2;a:10:{s:17:"availability_type";s:6:"custom";s:9:"from_date";s:11:"2020-05-27 ";s:13:"from_week_day";s:1:"1";s:10:"from_month";s:1:"1";s:9:"from_time";s:0:"";s:11:"to_week_day";s:1:"1";s:8:"to_month";s:1:"1";s:7:"to_date";s:11:"2020-05-27 ";s:7:"to_time";s:0:"";s:10:"is_bokable";s:3:"yes";}}

【问题讨论】:

标签: mysql json database wordpress


【解决方案1】:

对不起,我的英语不好。 这是一个序列化的字符串,可以使用unserialize()转换成数组。

https://www.php.net/unserialize

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-01
    • 1970-01-01
    • 2023-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多