Home>Article>Backend Development> How to print out all methods of a class in php
php method to print out all methods of a class: You can use the get_class_methods() function to achieve this, which can return an array consisting of the method names of the class. If an error occurs, the function returns NULL.
get_class_methods() function can return an array composed of class method names. If an error occurs, NULL is returned.
(Recommended tutorial:php video tutorial)
Grammar format:
get_class_methods ( mixed $class_name )
Example:
Output results :
myclass myfunc1 myfunc2
Related recommendations:php training
The above is the detailed content of How to print out all methods of a class in php. For more information, please follow other related articles on the PHP Chinese website!