Home  >  Article  >  Backend Development  >  How to print out all methods of a class in php

How to print out all methods of a class in php

王林
王林Original
2020-09-28 10:18:043475browse

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.

How to print out all methods of a class in php

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn