title: Count matches in array of arrays PHP
body: <pre><code>Array
  (
      [0] =&gt; Array
      (
          [song] =&gt; More Than A Feeling
          [artist] =&gt; Not Boston
          [time] =&gt; 15:00
      )
  
      [1] =&gt; Array
      (
          [song] =&gt; More Than A Feeling
          [artist] =&gt; Boston
          [time] =&gt; 11:20
      )
      [2] =&gt; Array
      (
          [song] =&gt; More Than A Feeling
          [artist] =&gt; Boston
          [time] =&gt; 15:23
      )
  )
  </code></pre>
  
  <p>Have an array of arrays like this. I am trying to count all matches. Right now i'm using </p>
  
  <pre><code>array_count_values(array_column($arr, 'song'));
  </code></pre>
  
  <p>That's good but it counts songs if the artist doesn't match. I am trying to output the following. </p>
  
  <pre><code>Array
      (
      [0] =&gt; Array
      (
          [song] =&gt; More Than A Feeling
          [artist] =&gt; Not Boston
          [count] =&gt; 1
      )
  
      [1] =&gt; Array
      (
          [song] =&gt; More Than A Feeling
          [artist] =&gt; Boston
          [count] =&gt; 2
      )
  )
  </code></pre>
  
  <p>Not sure where to start. Thanks for the help!</p>