public function sort($a, $b) { if (is_array($a) && is_array($b)) { return $a['position'] - $b['position']; } return strcmp($a, $b); }