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

Explain the changes in php versions?

538


How to create a session? How to remove data from a session?

525


What is strlen function in php?

516


Can you specify the "new line" character in single-quoted strings?

548


How to fix "headers already sent" error in php

547






How many types of session are there?

542


Explain how to submit form without a submit button.

545


How to create a session? How to set a value in session?

522


How can we automatically escape incoming data?

537


How to convert a string to uppercase in php?

545


Where do I run php code?

530


Tell me how can we determine whether a variable is set?

509


Tell me how do you execute a php script from the command line?

517


Which PHP function would you use to send an email?

602


How long does a session last in php?

514