dniwebdesign

05-08-2006, 05:17 AM

function getDepth($id,$depth) {

//global $connection;

if($depth>10) {

return $depth;

}

else {

$depth = $depth+1;

echo $depth."<br>";

$this->getDepth(0,$depth);

// return $depth;

}

}

Alrighty, I have the above function, which right now should count to 11 then return the number (which should be 11). However although it does do the recursive and counts all the way to 11 it does not return the value once it is greater than 10. Why?

//global $connection;

if($depth>10) {

return $depth;

}

else {

$depth = $depth+1;

echo $depth."<br>";

$this->getDepth(0,$depth);

// return $depth;

}

}

Alrighty, I have the above function, which right now should count to 11 then return the number (which should be 11). However although it does do the recursive and counts all the way to 11 it does not return the value once it is greater than 10. Why?