title: PHP Sort Array based on values in another
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/348410/php-sort-an-array-based-on-another-array">PHP - sort an array based on another array?</a>  </p>
  </blockquote>
  
  
  
  <p>Need some help regarding array sorting....</p>
  
  <p>I have two arrays. The main one (where the key is the user id) :</p>
  
  <p>$user[31] = 'Tom'</p>
  
  <p>$user[43] = 'Jane'</p>
  
  <p>and another array with the order they should be displayed (where key is the order and value is the user id) : </p>
  
  <p>$order[1] = 43</p>
  
  <p>$order[2] = 31</p>
  
  <p>How can I apply the ordering to the main array using the ordering one? </p>
  
  <p>Thanks guys!</p>