title: Sort array by value and store in variable
body: <pre><code>$array = array(5,4,6,8,5,3,4,6,1);
  </code></pre>
  
  <p>I want to sort <code>$array</code> like <code>asort</code> does, but the problem is that <code>asort</code> is a function and its product can't be stored in a variable.</p>
  
  <p>How can I do something like this?:</p>
  
  <pre><code>$array = array(5,4,6,8,5,3,4,6,1);
  $sorted_array = asort($array);
  </code></pre>
  
  <p><strong>Edit:</strong> I also want <code>$array</code> to keep its original order.</p>