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

Which is better php or nodejs?

511


Whether php supports microsoft sql server?

549


Tell me what is pear?

545


Explain what are psrs? Choose 1 and briefly describe it?

505


What is laracast?

568






Does php support multiple inheritance?

489


What is difference between array_merge and array_combine?

512


Is array a key php?

511


What is composer used for?

505


Do you know how to delete a file from the system?

516


Tell me how can we define a variable accessible in functions of a php script?

520


How we load all classes that placed in different directory in one php file , means how to do auto load classes.

496


Tell me which function gives us the number of affected entries by a query?

516


What is the use of "enctype" attribute in a html form?

519


Should I use mysqli or pdo?

508