title: PHP-Sort array based on another array?
body: <p>OK, I already got this question in stackoverflow but sadly it's in javascript - <a href="https://stackoverflow.com/questions/13304543/javascript-sort-array-based-on-another-array">Javascript - sort array based on another array</a></p>
  
  <p>and I want it in PHP</p>
  
  <pre><code>$data = array(
     "item1"=&gt;"1",
     "item2"=&gt;"3",
     "item3"=&gt;"5",
     "item4"=&gt;"2",
     "item5"=&gt;"4"
  );
  </code></pre>
  
  <p>to match the arrangement of this array:</p>
  
  <pre><code>sortingArr = array("5","4","3","2","1");
  </code></pre>
  
  <p>and the output I'm looking for:</p>
  
  <pre><code>$data = array(
      "item3"=&gt;"5",
      "item5"=&gt;"4",
      "item2"=&gt;"3",
      "item4"=&gt;"2",
      "item1"=&gt;"1"
   );
  </code></pre>
  
  <p>Any idea how this can be done?
  Thanks.</p>