What does an array mean ($ this, $ some_method_string)?

Sorry if this may seem very simple, but what does it mean:

array($this, $some_method_string) 

in this piece of code:

 array_map(array($this, $some_method_string), $some_data) 
+6
source share
2 answers
 array($this, $some_method_string) 

this is a valid callback calling $ some_method_string on $ this:

with array_map, for each element of $ some_data call $this->$some_method_string(currentElement)

+6
source

You have a function named for example. function my_function ...

You must specify the name of this function as a string or string variable.

0
source

All Articles