title: PHP: Function to group array of objects by value
body: <p>I am working with a multi-dimensional array. How can I remove duplicates by value? In the following array, [0], [2] and [5] have the same [ID]. Is there a function that will remove any duplicate arrays based on a particular value? In this case, I would like to remove array [2] and array [5], as they have the same [ID] as array [0].</p>
  
  <p>Thank you for any information you may have.</p>
  
  <pre><code>        Array
  (
      [0] =&gt; stdClass Object
          (
              [d] =&gt; 2010-10-18 03:30:04
              [ID] =&gt; 9
          )
  
      [1] =&gt; stdClass Object
          (
              [d] =&gt; 2010-10-18 03:30:20
              [ID] =&gt; 4
          )
  
      [2] =&gt; stdClass Object
          (
              [d] =&gt; 2010-11-03 16:46:34
              [ID] =&gt; 9
          )
  
      [3] =&gt; stdClass Object
          (
              [d] =&gt; 2010-11-02 03:19:14
              [ID] =&gt; 1
          )
  
      [4] =&gt; stdClass Object
          (
              [d] =&gt; 2010-05-12 04:57:34
              [ID] =&gt; 2
          )    
  
      [5] =&gt; stdClass Object
          (
              [d] =&gt; 2010-05-10 05:24:15
              [ID] =&gt; 9
          )
  
  )
  </code></pre>