title: Sort array by other one - PHP
body: <p>Ive got 2 arrays, first one contains values of objects, and second one contains their IDs.
  <br>
  In this form:</p>
  
  <pre><code>$values[0] applies to $ids[0]
  $values[1] applies to $ids[1]
  </code></pre>
  
  <p>I need to sort first array (using sort() ) from lowest to highest (values are ints) - That's not problem.
  Problem is, that When I sort array with values, I will lost ID of that value.
  <br>
  My question is: How to make that </p>
  
  <pre><code>If $values[0] turns to $values[5], automatically turn $ids[0] to $ids[5]
  </code></pre>
  
  <p><br>
  Thanks</p>
  
  <p><br>
  Update:
  <br>
  Content of $values and $ids:</p>
  
  <pre><code>$values[0] = 1.5;
  $values[1] = 2.4;
  $values[2] = 15.7;
  $values[3] = 11.7;
  $values[4] = 4.8;
  $values[5] = 0.4;
  
  $ids[0] = 1;
  $ids[1] = 2;
  $ids[2] = 3;
  $ids[3] = 4;
  $ids[4] = 5;
  $ids[5] = 6;
  </code></pre>