title: Find Array Class Object value - If exists: Move it as first array key
body: <p>I'm looking for a php function that would find array class object value 'FIND_ME' and swap it as first array key if it exists.</p>
  
  <p>Here is my current Array output :</p>
  
  <pre><code>Array ( 
          [0] =&gt; stdClass Object ([id] =&gt; 1 [uid] =&gt; 52 [type] =&gt; A_TEST [title] =&gt; TITLE [value] =&gt; 1 ) 
          [1] =&gt; stdClass Object ([id] =&gt; 2 [uid] =&gt; 52 [type] =&gt; TEST [title] =&gt; TITLE [value] =&gt; 1 )
          [2] =&gt; stdClass Object ([id] =&gt; 3 [uid] =&gt; 52 [type] =&gt; FIND_ME [title] =&gt; TITLE [value] =&gt; 1 )
      )
  </code></pre>
  
  <p>And here is the result I need :</p>
  
  <pre><code>Array ( 
          [0] =&gt; stdClass Object ([id] =&gt; 3 [uid] =&gt; 52 [type] =&gt; FIND_ME [title] =&gt; TITLE [value] =&gt; 1 ) 
          [1] =&gt; stdClass Object ([id] =&gt; 2 [uid] =&gt; 52 [type] =&gt; TEST [title] =&gt; TITLE [value] =&gt; 1 )
          [2] =&gt; stdClass Object ([id] =&gt; 1 [uid] =&gt; 52 [type] =&gt; A_TEST [title] =&gt; TITLE [value] =&gt; 1 )
      )
  </code></pre>
  
  <p>Result : Array[2] changed and became Array[0] because <code>type =&gt; FIND_ME</code> was found in the array.</p>
  
  <p>Note: I don't care about the order of others keys.</p>
  
  <p>Any idea?</p>
  
  <p>EDIT: Okay I managed to find the key number of <code>type =&gt; FIND_ME</code> using foreach() :</p>
  
  <pre><code>foreach($array as $key =&gt; $value) {
          if ($value-&gt;type == 'FIND_ME') {
              $found = $key;
              break;
          }
      }
  </code></pre>
  
  <p>But how to swap it as first key of the array?</p>