title: How to assign new numerical keys to an array and sort based on the original keys?
body: <p>I have an array with numerical indices, which looks like this (after I unset some elements):</p>
  <pre><code>$array = [
      23 =&gt; 'banana',
      3 =&gt; 'apple',
      5 =&gt; 'pear',
  ];
  </code></pre>
  <p>Which function do I use to reorder them based on their key order to:</p>
  <pre><code>$array = [
      0 =&gt; 'apple',
      1 =&gt; 'pear',
      2 =&gt; 'banana',
  ];
  </code></pre>
  <p>I tried some of the sort functions but none of them provided the output I need.</p>