Re: [PHP] array walk and class member functions

2005-01-12 Thread Jochem Maas
Jason Barnett wrote: indeed that page does not make it very clear, it's the generic call_back syntax, which can be used practically everywhere a callback function is expected, the array you pass can be in the form of: array($object, 'methodname') or array('classname', 'methodname') the second ve

Re: [PHP] array walk and class member functions

2005-01-12 Thread Tom
Thanks very much for the help - both methods work fine. I'd had a look at the array_walk manual, but didn't realise that the second param would accept an array - that's really cool! I don't like the function_exists method much, as I frequently overload class members. Not needed now as I have th

Re: [PHP] array walk and class member functions

2005-01-12 Thread Jason Barnett
indeed that page does not make it very clear, it's the generic call_back syntax, which can be used practically everywhere a callback function is expected, the array you pass can be in the form of: array($object, 'methodname') or array('classname', 'methodname') the second version allows you to u

Re: [PHP] array walk and class member functions

2005-01-12 Thread Jochem Maas
Tom wrote: > Thanks very much for the help - both methods work fine. I'd had a look > at the array_walk manual, but didn't realise that the second param would > accept an array - that's really cool indeed that page does not make it very clear, it's the generic call_back syntax, which can be used pr

Re: [PHP] array walk and class member functions

2005-01-12 Thread Jochem Maas
Jochem Maas wrote: Tom wrote: Sorry Tom, I hit the send button too early! I mean to add some context to the code below so you would (hopefully) understand what I mean: OR define the function outside of the class e.g. function aFunction($value, $key) { global $aReturnString; $aReturnStri

Re: [PHP] array walk and class member functions

2005-01-12 Thread Jochem Maas
Tom wrote: Hi I'm batting my head against a wall on this one... I have a class that has a constructor which sets some initial conditions, and then a public function that does some work. I want to be able to call this function from an external array_walk call, but when I try and reference it as $

[PHP] array walk and class member functions

2005-01-12 Thread Tom
Hi I'm batting my head against a wall on this one... I have a class that has a constructor which sets some initial conditions, and then a public function that does some work. I want to be able to call this function from an external array_walk call, but when I try and reference it as $myClass->my