title: Sort multidimensional array based on another array
body: <p>I have one array <code>($sort)</code> that looks like:</p>
  
  <pre><code>  [1]=&gt;16701
  
    [2]=&gt;16861
  
    [3]=&gt;16706
  </code></pre>
  
  <p>And an array <code>($images)</code>, which looks like:</p>
  
  <pre><code>  [0]=&gt;
    array(4) {
      ["href"]=&gt; string(35) "mystring"
      ["url"]=&gt;  string(67) "mystring2"
      ["didascalia"]=&gt; string(29) "mystring3"
      ["id"]=&gt; 16861
    }
    [1]=&gt;
    array(4) {
      ["href"]=&gt; string(35) "mystring"
      ["url"]=&gt;  string(70) "mystring2"
      ["didascalia"]=&gt; string(37) "mystring3"
      ["id"]=&gt; 16706
    }
    [2]=&gt;
    array(4) {
      ["href"]=&gt; string(35) "mystring"
      ["url"]=&gt;  string(66) "mystring2"
      ["didascalia"]=&gt; string(24) "mystring3"
      ["id"]=&gt; 16701
    }
  </code></pre>
  
  <p>I need to sort <code>$images</code>, based on value <code>"id"</code>, using <code>$sort</code>.
  So my result should be</p>
  
  <pre><code>[0]=&gt;
  array(4) {
    ["href"]=&gt; string(35) "mystring"
    ["url"]=&gt;  string(66) "mystring2"
    ["didascalia"]=&gt; string(24) "mystring3"
    ["id"]=&gt; 16701
  }
  
  [1]=&gt;
  array(4) {
    ["href"]=&gt; string(35) "mystring"
    ["url"]=&gt;  string(67) "mystring2"
    ["didascalia"]=&gt; string(29) "mystring3"
    ["id"]=&gt; 16861
  }
  
  [2]=&gt;
  array(4) {
    ["href"]=&gt; string(35) "mystring"
    ["url"]=&gt;  string(70) "mystring2"
    ["didascalia"]=&gt; string(37) "mystring3"
    ["id"]=&gt; 16706
  }
  </code></pre>
  
  <p>How can I do it?
  I tried using multisort, array_map but without success.</p>