title: Removing duplicates from multidimensional array based on the first elements only PHP
body: <p>This is the array</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [artist] =&gt; John Keys
              [postID] =&gt; 254
          )
  
      [1] =&gt; Array
          (
              [artist] =&gt; Jay Bloom
              [postID] =&gt; 249
          )
  
      [2] =&gt; Array
          (
              [artist] =&gt; John Keys
              [postID] =&gt; 216
          )
  
      [3] =&gt; Array
          (
              [artist] =&gt; Angie Belle
              [postID] =&gt; 225
          )
  )
  </code></pre>
  
  <p>and I want to remove all duplicates from the artist elements only. Notice that 0 and 2 have the same artist but a different postID. I just want to keep the first occurence of the artist and remove all others. So the result I want to have is</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [artist] =&gt; John Keys
              [postID] =&gt; 254
          )
  
      [1] =&gt; Array
          (
              [artist] =&gt; Jay Bloom
              [postID] =&gt; 249
          )
      [2] =&gt; Array
          (
              [artist] =&gt; Angie Belle
              [postID] =&gt; 225
          )
  )
  </code></pre>
  
  <p>I've tried array_unique and also serializing and doing an array_map, nothing seems to work right.</p>