填写特定键和值的缺失日期

时间:2016-06-27 15:57:33

标签: php

我有一个数组:

array (size=3)
  0 =>
    array (size=3)
      'quantity' => string '20' (length=2)
      'date' => string '2016-01-01' (length=10)
      'eID' => string '2' (length=1)
  1 =>
    array (size=3)
      'quantity' => string '10' (length=2)
      'date' => string '2016-03-01' (length=10)
      'eID' => string '2' (length=1)
  2 =>
    array (size=3)
      'quantity' => string '15' (length=2)
      'date' => string '2016-01-01' (length=10)
      'eID' => string '1' (length=1)

如何填写每个'eID'的缺失日期?所以输出将是:

array (
   0 =>
     array (
       'quantity' => string '20' (length=2)
       'date' => string '2016-01-01' (length=10)
       'eID' => string '2' (length=1)
   1 =>
     array (
       'quantity' => null
       'date' => string '2016-02-01' (length=10)
       'eID' => string '2' (length=1)
   2 =>
     array (
       'quantity' => string '10' (length=2)
       'date' => string '2016-03-01' (length=10)
       'eID' => string '2' (length=1)

...直到2016-12-01。每个'eID'键的12个数组具有相同的值

0 个答案:

没有答案