All tidy objects have an id properity which allows them to be identified by comparing it to a constant. Node constants have the form TIDY_NODE_< TAGNAME >  while attributes are TIDY_ATTR_< ATTR_NAME >.

<?php

    tidy_parse_file
('test.html');
    
$body tidy_get_body();
    if(
$body->id == TIDY_NODE_BODY) {
        echo 
"Yep, we got the body...";
    }
    
?>