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

Is php a strongly typed language?

756


Which is not a file-related function in php?

805


Why print_r is used in php?

730


Tell me what are magic methods?

744


How do I make a reset button in html?

710


Can we override static method in php?

775


What is the difference between mysql_fetch_array() and mysql_fetch_assoc()?

736


How to send email using php script?

743


How come the code works, but does not for two-dimensional array of mine?

710


How can we enable error reporting in php?

691


What sized websites have you worked on in the past?

751


Is php a case sensitive language?

930


What are the correct and the most two common way to start and finish a PHP block of code?

826


What is data structure in php?

738


Tell me what is the main difference between require() and require_once()?

731