title: Foreach Sorting
body: <p>I'm not too sure if this is possible but I will try to explain it anyhow, </p>
  
  <p>We are trying to make a page for our guild and we want it to display the Average Item level Equipped along with their name e.g.</p>
  
  <pre><code>Name | iLvL 
  Bob    262
  Sam    159
  </code></pre>
  
  <p>We are currently running a script that is doing the following : </p>
  
  <pre><code>$members = $guild-&gt;getMembers();
  </code></pre>
  
  <p>This basically gets a list of all members in our guild - We are then iterating through with a foreach loop and making another call to get bits of information</p>
  
  <pre><code>//Character Arrays
  foreach($members as $member) {
  
  //Get character information
  $mrank = $member['rank'];
  $mname = $member['character']['name'];
  $mgender = $member['character']['gender'];
  $mlevel = $member['character']['level'];
  $mrace = $member['character']['race'];
  $character = $armory-&gt;getCharacter($mname);
  $gear = $character-&gt;getGear();
  $milevel = $gear['averageItemLevelEquipped'];
  echo '&lt;td&gt;&lt;div align="center" class="style1"&gt;'. $mname .'&lt;/div&gt;&lt;/td&gt;';
  echo '&lt;td&gt;&lt;div align="center" class="style1"&gt;'. $milevel .'&lt;/div&gt;&lt;/td&gt; ';
  </code></pre>
  
  <p>The only problem is because we iterate through them singular im not too sure how I could sort the Average Item Level into highest to lowest - I've heard of things like rsort but i couldn't seem to get it to work and I was wondering if anyone would be able to lend a hand with this.</p>
  
  <p>Thanks</p>