title: PHP array sort different ways
body: <p>I export from MYSQL db different info that I put inside an array:</p>
  
  <pre><code>$info=array(
  (ID,CALORIES,PROTEIN,CARBOS,FIBER),
  ...
  );
  ex: (1,270,24,12,5),(2,280,2,42,10),...
  </code></pre>
  
  <p>Then, further down the script, I need to get the IDs of the 3 products with the highest calories, of the 6 products with the highest result of 2xPROTEIN+3xCARBOS, etc for 5 charts.</p>
  
  <p>How can I do such a sorting of the array to fill my different tables?</p>
  
  <p>The function sort() only seems to work for a single-dimensioned array (if it works for my case, I don't know what would be the syntax). It also doesn't seem to work for my more advanced sortings (2*x+3*y)...</p>