tags:

views:

37

answers:

2

Function call:

 $trdata .= $this->table_td($tddata, 1, $td);

Function:

public function table_td($data = '', $parameters = array()){
    return($this->table_thtd($data, 0, $parameters));
}

A print_r before the return shows a 1, instead of the data array I'm passing. Any thoughts on what's going on?

+4  A: 

You're passing a 1 as the second argument to the function call, and your $parameters argument is the second argument in the function definition... what do you expect?

Amber
Apparently I should have gone to bed a little earlier than I did.
Ben Dauphinee
+1  A: 

Two-argument function:

public function table_td(
    $data = '',            # one
    $parameters = array()  # two
) { ... }

Three-argument function call:

$trdata .= $this->table_td(
    $tddata,              # one
    1,                    # two
    $td                   # three
);

Hmmm. And you wonder why the second parameter ($parameters) gets set to the second argument (1)?

amphetamachine