Home > Article > Backend Development > How to get all methods of a class in php
php can use the get_class_methods() function to obtain all methods of a class. This function can return an array consisting of the method names of the class, or NULL if an error occurs. Function syntax: [get_class_methods($class_name)].
php provides us with a function get_class_methods, which can return an array composed of class method names, and returns NULL if an error occurs.
(Recommended video tutorial: php video tutorial)
Grammar:
array get_class_methods ( mixed $class_name )
(Related recommendation: php training)
Code example:
Output:
myclass myfunc1 myfunc2The above is the detailed content of How to get all methods of a class in php. For more information, please follow other related articles on the PHP Chinese website!