- print_r: documentation ( source)
<?php
$term_ids_weirdstuff = array(
0 => array('tid' => 1),
1 => array('tid' => 2),
2 => array('tid' => 3),
);
$term_ids=array();
foreach( $term_ids_weirdstuff as $dt)$term_ids[]=$dt['tid'];
$dt[]=$val['tid'];
print_r($term_ids);
?>