<?php
// Declare the interface 'testInterface'
interface testInterface
{
public function getid($name, $id);
public function getname($template);
}
// Implement the interface
// This will work
class test implements testInterface
{
public function getid($name, $id)
{
return "Did you call $name $id too";
}
public function getname($template)
{
return "Template called $template";
}
public function getextra($data)
{
return "Independent function called $data";
}
}
$t = new test();
echo $t->getname("manas");
echo "<br>";
echo $t->getid("netscape","12345");
echo "<br>";
echo $t->getextra("45678");
?>