call a modules function from preprocess_page
You are getting a taxonomy id. However, taxonomy_get_tree needs a vocabulary id as parameter, according to the documentation: https://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.module/function/taxonomy_get_tree/7.x . That's probably why you are getting an empty array.

In order to be able to call taxonomy_get_tree, you would need to get the vocabulary id first:

$term = taxonomy_term_load($tid);
$vid = $term-&gt;vid;
print_r(taxonomy_get_tree($vid));


(see this question for more details about getting the vid from a tid).