Ah! Got ya. Thank you! And sorry for asking general questions in the
framework list. So working code =

function page($parts, $i, $array){
          
          foreach($parts as $part){
          $page .= $part;
          }
                $array[$i] = $page;
                $i++;
                if($i < count($parts)){
                array_pop($parts);
                return page($parts, $i, $array);
                }else{
                return $array;
                }
        }




Jack Sleight wrote:
> 
> As I said, you're not returning the result of the page($parts, $i, 
> $array); call within the function (at line 10).
> 
> Waigani wrote:
>> Okay here is the modified code - no print_r no elseif, same problem - no
>> return. I can't see what is wrong with the recursive function??
>>
>> function page($parts, $i, $array){
>>        
>>        foreach($parts as $part){
>>        $page .= $part;
>>        }
>>              $array[$i] = $page;
>>              $i++;
>>              if($i < count($parts)){
>>              array_pop($parts);
>>              page($parts, $i, $array);
>>              }else{
>>              return $array;
>>              }
>>      }
>>
>>
>>
>>
>>
>> Holografix wrote:
>>   
>>
>>   
> 
> -- 
> Jack
> 
> 

-- 
View this message in context: 
http://www.nabble.com/function-does-not-return-tf4790342s16154.html#a13713821
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to