title: sorting array after array_count_values
body: <p>I have an array of products</p>
  
  <pre><code>$products = array_count_values($products);
  </code></pre>
  
  <p>now I have an array where $key is product number and $value is how many
  times I have such a product in the array.
  I want to sort this new array that product with the least "duplicates" are
  on the first place, but what ever I use (rsort, krsort,..) i loose product
  numbers (key).</p>
  
  <p>any suggestions?</p>
  
  <p>thanks.</p>