You look to be mising a return in your IF. Should be:
if($kat['upppercategory']==0){
return $kat['category'];
}
else {
return resolve_kat($kat['upppercategory']);
}
You can then pass it to another function.
$passtome = resolve_kat(927);
function otherFunction ($passtome) {
#What you want to do...
}