I need help to echo an array value


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

$str = explode("/",$url);
$slug = $str[count($str)-2];
echo $slug;

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


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?