Getting a taxonomy-term-name as plain-text in computed field In an entity-type with term-reference i want to add a computed field, which grabs the term and sanitizes it for further use with the drupal_clean_css_identifier for example. My code doesn't work, because field_get_items gives back a full link to the term instead the term name as plaintext: 

$entity_field[0]['value'] = drupal_clean_css_identifier(array_pop(field_get_items($entity_type, $entity, 'field_myterms'))));


Can someone help me out?
calling field_get_items() on a term reference field returns an array like this


Array(
  0 => Array(
    'tid' => 10,
  ),
)


to get the term name from the term id (tid) you should load the taxonomy term:


$field_myterms = field_get_items($entity_type, $entity, 'field_myterms');
if (!empty($field_myterms)) {
  $term = taxonomy_term_load($field_myterms[0]['tid']);
}


$term is an stdClass object: 


stdClass Object
(
    [tid] => 1
    [vid] => 1
    [name] => test
    [description] => 
    [format] => filtered_html
    [weight] => 0
    [vocabulary_machine_name] => tags
    [rdf_mapping] => Array
        (
            [rdftype] => Array
                (
                    [0] => skos:Concept
                )

            [name] => Array
                (
                    [predicates] => Array
                        (
                            [0] => rdfs:label
                            [1] => skos:prefLabel
                        )

                )

            [description] => Array
                (
                    [predicates] => Array
                        (
                            [0] => skos:definition
                        )

                )

            [vid] => Array
                (
                    [predicates] => Array
                        (
                            [0] => skos:inScheme
                        )

                    [type] => rel
                )

            [parent] => Array
                (
                    [predicates] => Array
                        (
                            [0] => skos:broader
                        )

                    [type] => rel
                )

        )

)


to set the computed field value:


$entity_field[0]['value'] = drupal_clean_css_identifier($term->name);