包含二进制数据的 JSON
我多年来一直致力于这方面的工作。我从对 API 的请求中收到一个 JSON
,不幸的是每个条目的键是一个二进制格式的时间 uuid。我正在尝试使用 json_decode() 将 json 解码为 PHP 数组。然而,当我回显该字符串时,我有大约 80 个条目,但在解码到数组中后,它会将其削减到大约 40 个条目,
我应该提到我不需要键中的这些值,我可以直接删除如果可能的话,可以使用 array_values() 来关闭它们吗?
任何建议都会有帮助谢谢!
这是一些示例数据
"\u001c":{"向下":"1280069835000","关闭":"1279893600000","打开":"1279886400000","向上":"1280077035000"},"=":{"向下" :“1280163435000”,“关闭”:“1279893600000”,“打开”:“1279886400000”,“向上”:“1280167035000”}
I've been on working on this for ages. I am receiving a JSON
from a request to an API and unfortunately the key's of each entry is a time uuid which is in binary format. I'm trying to use json_decode()
to decode the json into a PHP
array. However, when I echo the string I have about 80 entries but after the decode into the array, it trims it down to about 40 entries,
I should mention that I don't need these values that are in the keys, I could just strip them off if possible using array_values()
maybe?
Any advice would help Thanks!
Here's some sample data
"\u001c":{"down":"1280069835000","off":"1279893600000","on":"1279886400000","up":"1280077035000"},"=":{"down":"1280163435000","off":"1279893600000","on":"1279886400000","up":"1280167035000"}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我实际上联系了开发团队,他们将二进制 uuid 转换为字符串格式,效果非常好。看起来除了手动解析 JSON 之外,这种事情可能是不可能的。感谢大家的努力!
I actually contacted the development team, and they converted the binary uuid to string format, and it worked like a charm. Looks like this sort of thing may not be possible besides manually parsing out the JSON. Thanks for your efforts all!