All pastes #69486 Raw Edit

Unnamed

public text v1 · immutable
#69486 ·published 2006-06-23 00:42 UTC
rendered paste body
function niveau($cat_id,$A){
	//echo $A;
	if(parent_id($cat_id)==0) {
		return $A;
	} else {
		niveau(parent_id($cat_id),$A+1);	
	}
}

echo niveau(80,0);

//considering the parent function works, returning the parent's id of its argument