How the usort() sorting algorithm works?

How does the comparator work? I’m not sure wether this was part of the question, but to be clear about how the comparator works: You have an order specified by ordered list $order and a special comparator callback list_cmp which (should) return wether argument $a is smaller than $b (return -1 or a value < … Read more

Sorting multidim array: prioritize if column contains substring, then order by a second column

Personally, I would use a custom (anonymous) function in conjunction with usort(). EDIT: Re – your comment. Hopefully this will put you on the right track. This function gives equal priority to elements which both have EN or neither have EN, or adjusted priority when just one has EN. usort($array,function ($a, $b) { $ac = … Read more