Welcome Guest, Not a member yet? Register   Sign In
Can anyone explain how this usort actually works
#3

The term "weight" is often used to describe similar values in sorting algorithms, so I'll use it here as well ...

-1 means that $a has a lower weight than $b
0 means that $a and $b are equal
1 means that $a has a higher weight than $b

Higher weight values are moved in front of the lower weight values in the list, and because you'd eventually have all list items compared to each other, you end up with a sorted list. Smile
Reply


Messages In This Thread
RE: Can anyone explain how this usort actually works - by Narf - 09-28-2015, 02:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB