Drupal 7: Programmatically get the list of tags (taxonomy)

drupal, drupal-7, tags, taxonomy

Solution

Exactly. A slightly more complete example is (you can substitute with your own vocabulary vid):

if ($terms = taxonomy_get_tree($vocabulary->vid)) {
  foreach ($terms as $term) {
      // Do something with $term->tid or $term->name
  }
}

Problem

I need to programmatically create a list of the tags used in a Drupal 7 website. I'm browsing through the api/functions, but can't find something like "get_list_of_terms()" :-) How should I proceed? Thanks! J.

Original source