public static function get_sorted_subjects() {
        $subjects = get_string_manager()->load_component_strings('edufields', current_language());

        // Sort the subjects.
        $return  = [];
        asort($subjects);
        foreach ($subjects as $key => $option) {
            $keylength = strlen($key);
            if ($keylength == 12) {
                $return[$key] = $option; // We want only selectable categories.
            }
        }
        return $return;
    }
public static function get_sorted_subjects() {
        $subjects = get_string_manager()->load_component_strings('edufields', current_language());

        // Sort the subjects.
        $return  = [];
        asort($subjects);
        foreach ($subjects as $key => $option) {
            $keylength = strlen($key);
            if ($keylength == 12) {
                $return[$key] = $option; // We want only selectable categories.
            }
        }
        return $return;
    }
public static function get_sorted_subjects ( ) { $ subjects = get_string_manager ( ) -> load_component_strings ( 'edufields' , current_language ( ) ) ; // Sort the subjects. $ return = [ ] ; asort ( $ subjects ) ; foreach ( $ subjects as $ key => $ option ) { $ keylength = strlen ( $ key ) ; if ( $ keylength == 12 ) { $ return [ $ key ] = $ option ; // We want only selectable categories. } } return $ return ; }
Retrieve all the sorted course subjects

@return array $subjects
Retrieve all the sorted course subjects