I need help to echo an array value

Hi,

I'm using this code to retrieve a term_id value based on the category slug...

<?php
$url = $_SERVER['REQUEST_URI'];
$str = explode("/",$url);
$slug = $str[count($str)-2];
echo $slug;
?>

<?php
global $wpdb;
$post_id = $wpdb->get_results("SELECT term_id FROM wp_terms WHERE slug LIKE '$slug'");

var_dump($post_id);
?>

This returns example:

array(1) { [0]=> object(stdClass)#910 (1) { ["term_id"]=> string(2) "76" } }

I need to get that 76 to further my code.

How to do that?