Copyright © tutorialspoint.com
| class_exists ( $class_name [,$autoload] ); |
This function checks if the given class have been defined. Returns TRUE if class_name is a defined class, FALSE otherwise.
| Parameter | Description |
|---|---|
| class_name | Required. The class name. |
| autoload | Optional. Whether to call __autoload or not by default. |
Returns TRUE if class_name is a defined class, FALSE otherwise.
Following is the usage of this function:
<?php
if (class_exists('MyClass')) {
$myclass = new MyClass();
}
?>
|
Copyright © tutorialspoint.com