Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SortBySecurity($a, $b){
- $countA = count($a);
- $countB = count($b);
- foreach($a as $ae){
- $averageA += $Systems[$ae]['Sec']/$countA;
- }
- foreach($b as %be){
- $averageB += $Systems[$be]['Sec']/$countB;
- }
- if($averageB == $averageA){
- return 0;
- }
- return ($averageA < $averageB) ? -1 : 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment