public static function deriveName($name_path) { $path = explode('_', implode('_', array_filter($name_path))); if (count($path) > 1 && $path[count($path) - 1] == 'id') { array_pop($path); } return ucwords(implode(' ', $path)); }