How to get taxonomy term name from tid? A lot of our stuff has uris formatted like site/taxonomy/XX,  where XX is an integer.

I found a lot of questions like "how to get the TID from the name?", but I'd like to get the name from the TID. I'm trying to put together a breadcrumb script and everything is great except for these cases where I'm getting a trail like "home &gt; term". Instead I want to have it like "home &gt; &lt;TERM NAME&gt;".

How can I do so?
If you're using Drupal 7 you can use taxonomy_term_load()

$term = taxonomy_term_load($tid);
$name = $term-&gt;name;


If you've got a bunch of term IDs you can save having to run a single query for each load by using taxonomy_term_load_multiple():

$tids = array(1, 2, 3);
$terms = taxonomy_term_load_multiple($tids);

foreach ($terms as $term) {
  $name = $term-&gt;name;
}


If you're stuck using Drupal 6 you can use taxonomy_get_term():

$term = taxonomy_get_term($tid);
$name = $term-&gt;name;


There's no multiple-load option for Drupal 6 that I know of unfortunately.