PHP USort Method of Class
private static function merchantSort($a,$b) {
return ...// the sort
}
$array = $this->someThingThatReturnAnArray();
usort($array, array('ClassName','merchantSort'));
Matteoweb