get_class_methods

array get_class_methods(string class_name) 

Gets the names of the methods for a given class.

Returns:

Array containing the name(s) of an object’s method(s); NULL if class_name is not the name of a defined class

Description:

get_class_methods() finds the names of the methods for a given class and returns them as an array. If class_name is not the name of a defined class, the function returns NULL.

Availability:

UNIX, Windows

Version:

4.0RC1+

See also:

To find the member variables (and their values) for a class or an object:

get_class_vars() 
get_object_vars() 

Example:

Find the names of the methods of a class
 class locomotion { function walk () { // Do something... } function run () { // Do something... } function crawl () ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.