Copyright © tutorialspoint.com
| interface_exists ( $interface_name [, $autoload] ); |
This function checks if the given interface has been defined.
| Parameter | Description |
|---|---|
| interface_name | Required. The interface name |
| autoload | Optional. Wether to call __autoload or not by default. |
Returns TRUE if the interface given by interface_name has been defined, FALSE otherwise.
Following is the usage of this function:
<?php
if (interface_exists('MyInterface')) {
class MyClass implements MyInterface
{
// Methods
}
}
?>
|
Copyright © tutorialspoint.com