如何在单个数组中存储相同的数据密钥

时间:2019-04-24 10:20:58

标签: php

检查支架 当前结果:

[{"Date":"2019-02-18","type":"Casual Leave","value":0},
 {"type":"Sick Leave","value":0},
 {"type":"Emergency Leave","value":0},
 {"type":"Comp Off","value":0},
 {"Date":"2019-02-19","type":"Casual Leave","value":0},
 {"type":"Sick Leave","value":0},
 {"type":"Emergency Leave","value":0},
 {"type":"Comp Off","value":0}]

预期结果:

[{"Date":"2019-02-18",
  "type":"Casual Leave","value":0,
  "type":"Sick Leave","value":0,
  "type":"Emergency Leave","value":0,
  "type":"Comp Off","value":0},
 {"Date":"2019-02-19",
  "type":"Casual Leave","value":0,
  "type":"Sick Leave","value":0,
  "type":"Emergency Leave","value":0,
  "type":"Comp Off","value":0}]

0 个答案:

没有答案