包含二进制数据的 JSON

发布于 2024-09-12 07:49:55 字数 505 浏览 1 评论 0原文

我多年来一直致力于这方面的工作。我从对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风蛊 2024-09-19 07:49:55

我实际上联系了开发团队,他们将二进制 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文