- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
interface_exists() function in PHP
The interface_exists() function checks if the interface has been defined. It returns TRUE if the interface given by name_of_interface has been defined, else FALSE is returned.
Syntax
interface_exists(name_of_interface, autoload)
Parameters
name_of_interface − The interface name.
autoload − To call __autoload or not by default
Return
The interface_exists() function returns TRUE if the interface given by name_of_interface has been defined. It returns FALSE otherwise.
Example
The following is an example −
<?php if (interface_exists('DemoInterface')) { class MyClass implements DemoInterface { // Methods } } ?>
Advertisements