How to display sub-categories depending on what category you’re in.

Arhh, it took me a while, but I finally figured this out. Decided to share 🙂

$cat = get_the_category();
$cat_id = $cat[0]->category_parent;
if($cat_id != 0 && !is_home()) {
wp_list_categories("title_li=&child_of=$cat_id");
}