定义接口:
interface jiekou { public function hello(); }?>
使用接口:
class ClassName implements jiekou { public $message = 'Hello world'; public function hello() { echo $this->message; } } $obj = new ClassName(); $obj->hello();?>