title: Two dependent arrays, need to sort by elements of the first one
body: <p>I know this is definitively a bad design, but at this moment, it is the only way how I can figure this out.</p>
  
  <p>I have two arrays. One filled with string values, second one with integers for instance:</p>
  
  <pre><code>$array01 = array("apple", "bannana", "orange", "plum", "kiwi", "kiwi");
  $array02 = array(2, 4, 3, 2, 1, 2);
  </code></pre>
  
  <p>Values are linked to each other.</p>
  
  <pre><code>apple - 2, bannana - 4, orange - 3, plum - 2, kiwi - 1, kiwi - 2.
  </code></pre>
  
  <p>As shown, values in each array may be duplicated (I can't remove redundance).</p>
  
  <p>I need to sort the first array by alphabet ascending - but as you already know - I need to shake with the second array exactly as I shake with first array in order to sort it, so the values will match after the sort.</p>
  
  <p>My question: Is there an easy way to do this? Or I simply have to write my own sort algorhytm? Note that I can not use any external libraries. </p>
  
  <p>Thanks in advance!</p>