title: Sort stdClass Object after an array
body: <p>I have two arrays, </p>
  
  <pre><code>Array
  (
      [0] =&gt; stdClass Object
          (
              [id] =&gt; 1
              [title] =&gt; art
          )
      [1] =&gt; stdClass Object
          (
              [id] =&gt; 4
              [title] =&gt; adsdf
          )
      [2] =&gt; stdClass Object
          (
              [id] =&gt; 2
              [title] =&gt; adsdf
          )
      [3] =&gt; stdClass Object
          (
              [id] =&gt; 7
              [title] =&gt; adsdf
          )
  
  )
  Array
  (
      [2] =&gt; 2
      [1] =&gt; 1
  )
  </code></pre>
  
  <p>And I want to sort the first array after the second array. In the second array the key and the value is equal with the first array id. So the output have to be the following.</p>
  
  <pre><code>Array
  (
      [0] =&gt; stdClass Object
          (
              [id] =&gt; 2
              [title] =&gt; adsdf
          )
      [1] =&gt; stdClass Object
          (
              [id] =&gt; 1
              [title] =&gt; art
          )
      [2] =&gt; stdClass Object
          (
              [id] =&gt; 4
              [title] =&gt; adsdf
          )
      [3] =&gt; stdClass Object
          (
              [id] =&gt; 7
              [title] =&gt; adsdf
          )
  
  )
  </code></pre>