Home  >  Article  >  Backend Development  >  What are the methods of getting all the classes in PHP

What are the methods of getting all the classes in PHP

coldplay.xixi
coldplay.xixiOriginal
2020-11-04 14:45:012257browse

PHP method to get all methods of a class: 1. Get the class name of the class where the current statement is located, the code is [get_class(class name or class obj)]; 2. Get all the method names of the class name class, and form an array.

What are the methods of getting all the classes in PHP

PHP method to get all methods of a class:

Get the class name of the class where the current statement is located

get_class(class name or class obj);

Get all the method names of the class name and form an array

get_class_methods(class name or class obj);

Get all the variable names of the class and form an array

get_class_vars(class name or class obj);

Related Free learning recommendations: php programming (video)

The above is the detailed content of What are the methods of getting all the classes 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