Reputation: 4867
Sorry if it might appear very simple, but what does that mean:
array($this, $some_method_string)
in this piece of code:
array_map(array($this, $some_method_string), $some_data)
Upvotes: 10
Views: 4952
Reputation: 33439
You have a function with a name, e.g. function my_function ...
.
You have to give the name of that function as a string or string variable.
Upvotes: 0
Reputation: 20155
array($this, $some_method_string)
it is a valid callback , calling the method $some_method_string on $this :
with array_map , for every element of $some_data , call $this->$some_method_string(currentElement)
Upvotes: 8