Sorry for this dumb question, but I really don't see what I'm doing wrong :(
I've this 2 functions within a class
function getParentCat($treeTag)
{
// fetch some db data
$parentId = $row->Fparent_id;
$parentArray = array();
if ($parentId > 0) {
$parentArray = $this->iterateParentCat($parentArray,$parentId);
// print_r here show nothing, no array, nothing !
} else {
$parentArray[] = $treeTag;
}
return $parentArray;
}
And the second function :
function iterateParentCat($parentArray,$parentId)
{
// Fetch some db data
$parentArray[] = $row->Ftag;
if ($row->Fparent_id > 0) {
$this->iterateParentCat($parentArray,$row->Fparent_id);
} else {
// print_r here show a perfect, beautiful array
return $parentArray;
}
}
So it seems I've lost the array (not just the content, the whole array) between the 2 functions. It must be a simple thing... but I can't see it ! Soooory :)
return $this->iterateParentCat($parentArray,$row->Fparent_id);?