【发布时间】:2015-08-19 05:13:00
【问题描述】:
我有一个这样的 json:
[
{
"event": "hard_bounce",
"_id": "323418ee24f744859ce7b7e01f28e0d1",
"msg": {
"ts": 1433426374,
"_id": "323418ee24f744859ce7b7e01f28e0d1",
"state": "bounced",
"subject": "Subject",
"email": "testMail@hotmail.com",
"tags": [],
"smtp_events": [],
"resends": [],
"_version": "HM-1sBYhpAPYoUvSCE2-Zw",
"diag": "smtp;550 Requested action not taken: mailbox unavailable",
"bgtools_code": 10,
"sender": "noreply@domain.net",
"template": null,
"bounce_description": "bad_mailbox"
},
"ts": 1433427203
}
]
我必须得到email 的值。我怎么才能得到它?我的意思是我必须得到testMail@hotmail.com
我如何用 php 做到这一点?
【问题讨论】:
-
到目前为止你尝试过什么?你甚至用谷歌搜索过这个,因为它很简单。你使用
json_decode。 -
PHP 为这些事情提供了许多方便的函数。你应该搜索这样的东西。例如 json 提供了反序列化 json 编码数据的功能。
-
顺便说一句,您似乎在请求 mandrill 或 mailchimp api。他们有图书馆。
标签: php