what is interface in php? how it is use?

Answer Posted / sivannarayana

interface = multiple inheritance

means:
An interface is a named collection of method definitions, without implementation.

example:
interface interfaceName{
public function func1();
public function func2();
}

//we will use this interface as
class ClassName implements interfaceName
{
//note all interface func's must implement here
}

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to read one character from a file?

799


How to select a database?

744


How can cross site request forgery csrf be prevented?

705


Name and explain five of the PHP error constants?

740


Is php a mvc?

699


How to get complete current page url in php?

821


What is the use of trim function in php?

735


What is the use of post in php?

716


What is session management php?

796


What is the use of die in php?

716


What is difference between Method overriding and overloading in PHP?

787


How to remove html tags from data in php?

790


How do I check if a given variable is empty?

709


Do you know how to get the ip address of the client?

759


Can we learn php without html?

761