title: Combining arrays with common values
body: <p>I have an array of dates that looks like this:</p>
  
  <pre><code>Array
  (
      [0] =&gt; '2014-01-01'
      [1] =&gt; '2014-01-02'
      [2] =&gt; '2014-01-03'
      [3] =&gt; '2014-01-04'
      [4] =&gt; '2014-01-05'
      [5] =&gt; '2014-01-06'
      [6] =&gt; '2014-01-07'
  )
  </code></pre>
  
  <p>and I have another array of dates and counts that looks like this:</p>
  
  <pre><code>[All] =&gt; Array
      (
          [0] =&gt; Array
              (
                  [count] =&gt; 2
                  [date] =&gt; 2014-01-06
              )
  
          [1] =&gt; Array
              (
                  [count] =&gt; 1
                  [date] =&gt; 2014-01-03
              )
  
          [2] =&gt; Array
              (
                  [count] =&gt; 43
                  [date] =&gt; 2013-12-11
              )
  
          [3] =&gt; Array
              (
                  [count] =&gt; 103
                  [date] =&gt; 2013-12-10
              )
  
          [4] =&gt; Array
              (
                  [count] =&gt; 128
                  [date] =&gt; 2013-12-09
              )
  
          [5] =&gt; Array
              (
                  [count] =&gt; 75
                  [date] =&gt; 2013-12-08
              )
  
          [6] =&gt; Array
              (
                  [count] =&gt; 107
                  [date] =&gt; 2013-12-07
              )
  </code></pre>
  
  <p>I want to make a new associative array where all the keys are the dates from the first array above and all of the values are either the count matched up with the corresponding date or "0".</p>
  
  <p>So for instance, the new array would look like this:</p>
  
  <pre><code>Array
  (
      [2014-01-01] =&gt; 0
      [2014-01-02] =&gt; 0
      [2014-01-03] =&gt; 1
      [2014-01-04] =&gt; 0
      [2014-01-05] =&gt; 0
      [2014-01-06] =&gt; 2
      [2014-01-07] =&gt; 0
  )
  </code></pre>
  
  <p>Does that make sense? Please feel free to ask any questions you may have. Thank you!</p>