$method_name) { if (!preg_match("/(get|set)_api_(.*)/", $method_name, $matches)) { unset($class_methods[$key]); } } usort($class_methods, function ($a, $b) { if (!preg_match("/(get|set)_api_(.*)/", $a, $matchesA)) { return 0; } if (!preg_match("/(get|set)_api_(.*)/", $b, $matchesB)) { return 0; } return strcasecmp($matchesA[2], $matchesB[2]); }); ?>