Tutorials Point


  Learning PHP
  Advanced PHP
  PHP Function Reference
  PHP Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

PHP Function interface_exists()


previous

Advertisements

Syntax

interface_exists ( $interface_name [, $autoload] );

Definition and Usage

This function checks if the given interface has been defined.

Paramters

ParameterDescription
interface_nameRequired. The interface name
autoloadOptional. Wether to call __autoload or not by default.

Return Value

Returns TRUE if the interface given by interface_name has been defined, FALSE otherwise.

Example

Following is the usage of this function:

<?php
if (interface_exists('MyInterface')) {
    class MyClass implements MyInterface
    {
        // Methods
    }
}
?> 

previous Printer Friendly

Advertisements


  

Advertisements