Syntax
| get_class_methods ( $class_name ); |
Definition and Usage
Gets the class methods names. Returns an array of method names defined for the class specified by class_name. In case of an error, it returns NULL.
Paramters
| Parameter | Description |
|---|---|
| class_name | Required. The class name. |
Return Value
Returns an array of method names defined for the class specified by class_name. In case of an error, it returns NULL.
Example
Following is the usage of this function:
<?php
class myclass {
// constructor
function myclass()
{
return(true);
}
function myfunc1()
{
return(true);
}
function myfunc2()
{
return(true);
}
}
$class_methods = get_class_methods('myclass');
$class_methods = get_class_methods(new myclass());
foreach ($class_methods as $method_name) {
echo "$method_name<br>";
}
?>
|
It will produce following result:
myclass myfunc1 myfunc2 |
No comments:
Post a Comment