Page 1 of 1

array_walk on class functions

Posted: Tue Jul 08, 2008 3:51 pm
by kendall
Hi,

i am trying to do an array_walk on a class function

Code: Select all

array_walk($PublishVars->fields,array('DB', 'set_data_type_array'));
and i got an error
<b>Fatal error</b>: Using $this when not in object context in
the line that the error reffered to is

Code: Select all

function set_data_type_array($val){
        $val = $this->set_data_type($val);
    }
What is the correct syntax for array_walking class methods?

Re: array_walk on class functions

Posted: Tue Jul 08, 2008 6:44 pm
by Christopher

Code: Select all

array_walk($PublishVars->fields,array($object, 'set_data_type_array'));