【发布时间】:2021-12-23 17:05:13
【问题描述】:
我一直在为这个问题挠头好几个小时,但我似乎无法让它工作。 我有一个类似这个例子的 JSON 输出:
{
"response": {
"dataInfo": {
"foundCount": 494,
"returnedCount": 4
},
"data": [
{
"fieldData": {
"Closed_Date": "10/03/2021",
"Start_Date": "10/03/2021"
},
"portalData": {},
"recordId": "152962",
"modId": "3"
},
{
"fieldData": {
"Closed_Date": "11/14/2021",
"Start_Date": "11/06/2021"
},
"portalData": {},
"recordId": "153228",
"modId": "22"
},
{
"fieldData": {
"Closed_Date": "11/07/2021",
"Start_Date": "11/06/2021"
},
"portalData": {},
"recordId": "153329",
"modId": "7"
},
{
"fieldData": {
"Closed_Date": "11/08/2021",
"Start_Date": "11/08/2021"
},
"portalData": {},
"recordId": "153513",
"modId": "3"
}
]
},
"messages": [
{
"code": "0",
"message": "OK"
}
]
}
我想通过 Start_Date 字段使用 PHP 过滤此输出,并计算每个月创建的数量。我已经将 JSON 的结果放入一个带有 JSON 解码的数组中。
$urls = $ref->multicurlRestApi($urllinkarray, $postfield, $headers);
$decode_open = json_decode($urls[0],true);
例如 this 的输出如下。
10 月:1
11 月:3
现在非常感谢任何帮助,以免我发疯
【问题讨论】: