Many php Functions Support callback functions such as array_udiff and the array_usort callback function requires a callback type as its parameter, the official documentation clearly specifies six supported callback function parameter input methods. 1. Common global method 2. Object method, input array as parameter 3. static method call, input array as parameter 4
Many php Functions Support callback functions such as array_udiff and the array_usort callback function requires a callback type as its parameter, the official documentation clearly specifies six supported callback function parameter input methods. 1. Common global method 2. Object method, input array as parameter 3. static method call, input array as parameter 4
Many php Functions Support callback functions such as array_udiff, array_usort... The callback function needs to pass in a callback type as its parameter. The official documentation clearly specifies six supported callback function parameter input methods.
1. Common global methods
2. Object method. Input an array as a parameter.
3. static method call. Input an array as a parameter.
4. static method call. input strings as parameters
5. Common Methods of the parent class
6. closure or anonymous method
These are all anonymous functions called outside the class. What should we do when we want to call a method of this class inside the class?
In this case, we can use $ this
property; }}?>
In the past, I was stupid to define a global method in the header or tail of a single class file to solve this problem. Later I found that it could be called in this way, and I hope it will be helpful to everyone.
This call method is provided in the comments below the official document,
Original article address: php callback function. Thanks for sharing it with the original author.