Forum Moderators: coopster

Message Too Old, No Replies

array map passing an object

         

cdmn

1:56 am on Nov 5, 2007 (gmt 0)

10+ Year Member



Hi there,

simple question really.

I have a method DB::escape.

Right now im in a situation when i need to call this method like this: $this->db->escape().

So the question is: how to pass such call to array_map function? :-)

array_map(array($this, 'escape'), $array); to pass call to $this->escape. But what about $this->db->escape, cant really get this work..

F1, someone :-)

Habtom

4:53 am on Nov 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would have tried it this way:

array_map(array($this->db, 'escape'), $array);

Unless there is a different explanation for this, this should work.

cdmn

10:33 pm on Nov 5, 2007 (gmt 0)

10+ Year Member



me == embarrassed :-)
Thanks