I've created a mirrors system were people can vote for links (Work/Broken) The array looks like this
Array
(
[0] => Array
(
[id] => 1
[link] => link.com/file.zip
[filename] => file.zip
[good] => 10
[broken] => 5
)
[1] => Array
(
[id] => 2
[link] => link.com/file.zip
[filename] => file.zip
[good] => 10
[broken] => 9
)
[2] => Array
(
[id] => 3
[link] => link.com/file.zip
[filename] => file.zip
[good] => 6
[broken] => 0
)
[3] => Array
(
[id] => 4
[link] => link.com/file.zip
[filename] => file.zip
[good] => 0
[broken] => 0
)
[4] => Array
(
[id] => 5
[link] => link.com/file.zip
[filename] => file.zip
[good] => 2
[broken] => 5
)
What I'm trying to do is sorting the links based on this: the link who have the best score shows on top I want to calculate the score like this: score = Good - BAD
If the score is negative, it would show links with no votes, so the results of this system will be:
Array 2,0,1,3,4