Can anyone tell me why the following function will not return $return and yet
will print_r($return) as expected?

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);
                }
                elseif($i = count($parts)){
                $return = array_reverse($array);

                //this prints as expected
                print_r($return);

                //this returns nothing
                return $return;
                }
        }

//example
$i = 0; $parts = array('one','two',three'); $array = array();

//prints array
$array = page($parts, $i, $array);

//returns nothing.
print_r($array);

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

Reply via email to