title: Dedupe array of database results
body: <p>A result set from a PDO query is as follows...</p>
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [activity_link_type] =&gt; Category
          [data_id] =&gt; 1
      )
  
  [1] =&gt; Array
      (
          [activity_link_type] =&gt; Category
          [data_id] =&gt; 38
      )
  
  [2] =&gt; Array
      (
          [activity_link_type] =&gt; PData
          [data_id] =&gt; 108
      )
  
  [3] =&gt; Array
      (
          [activity_link_type] =&gt; PData
          [data_id] =&gt; 109
      )
  
  [4] =&gt; Array
      (
          [activity_link_type] =&gt; PData
          [data_id] =&gt; 112
      )
  
  [5] =&gt; Array
      (
          [activity_link_type] =&gt; PData
          [data_id] =&gt; 115
      )
  
  [6] =&gt; Array
      (
          [activity_link_type] =&gt; Role
          [data_id] =&gt; 6
      )
  )
  </code></pre>
  <p>I wish to 'dedupe' the array in the simplest means (without having to do multiple nested database queries) so it looks like the following...</p>
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [activity_link_type] =&gt; Category
          [data_id] =&gt; 1
          [data_id] =&gt; 38
      )
  
  [1] =&gt; Array
      (
          [activity_link_type] =&gt; PData
          [data_id] =&gt; 108
          [data_id] =&gt; 109
          [data_id] =&gt; 112
          [data_id] =&gt; 115
     
  [2] =&gt; Array
      (
          [activity_link_type] =&gt; Role
          [data_id] =&gt; 6
      )
  )
  </code></pre>
  <p>I've tried <code>array_merge()</code>, <code>array_merge_recursive</code>and <code>array_unique()</code> but they either don't do anything or dedupe the wrong level of the array!</p>
  <p>All help appreciated!</p>