I've this code that is situated around the search.php page and retrieves all of the groups for every publish and echo's out a hyperlink towards the first category:

    $category = get_the_category(); //print_r($category);
if ($category) {
  echo '<a href="' . get_category_link( $category[0]->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category[0]->name ) . '" ' . '>' . $category[0]->name.'</a> ';

What I have to do is make use of a similar code but that will get the kid-most/greatest category within the array?

This is actually the array thats printed out:

[0] => stdClass Object
    (
        [term_id] => 170
        [name] => ACS Series Suspended &amp; Crane Scales - EC Approved
        [slug] => uwe-acs-series-suspended-crane-scales
        [term_group] => 0
        [term_taxonomy_id] => 170
        [taxonomy] => category
        [description] => 
        [parent] => 3
        [count] => 4
        [object_id] => 1578
        [cat_ID] => 170
        [category_count] => 4
        [category_description] => 
        [cat_name] => ACS Series Suspended &amp; Crane Scales - EC Approved
        [category_nicename] => uwe-acs-series-suspended-crane-scales
        [category_parent] => 3
    )

[1] => stdClass Object
    (
        [term_id] => 3
        [name] => Crane Scales
        [slug] => crane-scales
        [term_group] => 0
        [term_taxonomy_id] => 3
        [taxonomy] => category
        [description] => 
        [parent] => 0
        [count] => 53
        [object_id] => 1578
        [cat_ID] => 3
        [category_count] => 53
        [category_description] => 
        [cat_name] => Crane Scales
        [category_nicename] => crane-scales
        [category_parent] => 0
    )

As you can tell, one category has parent->3 and also the other has parent->0. How do you make use of the above query to print the hyperlink just for a category with parent->3?

Its most likely fairly simple nevertheless its a little over my mind. Any help could be greatly appreciated!

Thanks

Dork

Add this function in you are theme/functions.php file :

function get_deep_child_category( $categories )
{
    $maxId = 0;
    $maxKey = 0;
    foreach ( $categories as $key => $value )
    {
        if ( $value->parent > $maxId )
        {
            $maxId = $value->term_id;
            $maxKey = $key;
        }
    }
    return $categories[$maxKey];
}

Then let us say as with you are example in theme/search.php you need to do

$categories = get_the_category();
if ( $categories ) :
    $deepChild = get_deep_child_category( $categories );
    ?>
        <a href="<?php echo get_category_link( $deepChild->term_id ); ?>" title="<?php echo sprintf( __( "View all posts in %s" ), $deepChild->name ); ?>"><?php echo $deepChild->name; ?></a>
    <?php 
endif;

From the knoledge there's not one other method of sorting groups through get_the_category() however i may be mistaken and also the code above wouldn't be the greatest method of doing things if that's the case .