what is interface in php? how it is use?

Answer Posted / raju

Interface gets useful when you need to extend a class from
more than one parent class since class can not do this.

Why would you want to implement just a single interface on a
class. After all, a class already has everything that an
interface has.

Is This Answer Correct ?    14 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the meaning of a persistent cookie?

708


Php says that an array is an ordered map. But how the values are ordered in an array?

764


What are the types of variables in php?

716


What is the main function of php?

733


Explain Traits in PHP?

665






How can we change the value of a constant?

693


Explain me what is x+ mode in fopen() used for?

714


Is key in array php?

717


Which variable declarations within a class is invalid in php?

684


What is the use of friend function in php?

695


What is difference between mysqli and mysql?

710


Tell me what is the definition of a session?

687


What is PHP? Who is the father or inventor of PHP?

775


What is difference between mysql_connect and mysqli_connect?

654


What are sql injections, how do you prevent them and what are the best practices?

698