| 
	
 | 
 Posted by MS on 04/12/07 12:57 
"Tyno Gendo" <you@localhost> wrote in message 
news:ruSdnXSpyIqqtYPbnZ2dnUVZ8qTinZ2d@bt.com... 
> Rienk Withaar wrote: 
> > Hello, I have the following problem: 
> > 
> > I want my function to return a value, $l, using the following function: 
> > 
> > function level($n,$l=0,$d=false) { 
> >   if ($d) { return $l; } 
> >   else { 
> >     $ff=get_folders(); 
> >     for ($i=0;$i<count($ff);$i++) { 
> >       if ($n==$ff[$i][0]) { 
> >         if ($ff[$i][4]!=0) { 
> >   $l++; 
> >   level($ff[$i][4],$l,$d); 
> > } 
> > else { 
> >   $d=true; 
> >   level($ff[$i][0],$l,$d); 
> > } 
> >       } 
> >     } 
> >   } 
> > } 
 
Having taken a quick look at this it seems that the variable $d is never set 
to true unless it is set at true for the original call of the function.
 
  
Navigation:
[Reply to this message] 
 |