Copyright © tutorialspoint.com
| method_exists ( $object, $method_name ); |
Checks if the class method exists in the given object.
| Parameter | Description |
|---|---|
| object | Required. The tested object |
| mthod_name | Required. The method name. |
Returns TRUE if the method given by method_name has been defined for the given object, FALSE otherwise.
Following is the usage of this function:
<?php
$directory = new Directory('.');
var_dump(method_exists($directory,'read'));
?>
|
It will produce following result:
bool(true) |
Copyright © tutorialspoint.com