This article mainly introduces the implementation method of a single php interface, which involves the basic definition and usage skills of the php interface. if you need it, refer to the example in this article to describe the implementation method of a single php interface. Share it with you for your reference. The specific implementation method is as follows:
<? Php interface staff_ I {function setID ($ id); function getID (); function setName ($ name); function getName ();} class staff implements staff_ I // this class is used to implement the staff_ I interface {private $ id; private $ name; function setID ($ id) {$ this-> id = $ id ;} function getID () {return $ this-> id;} function setName ($ name) {$ this-> name = $ name;} function getName () {return $ this-> name;} function otherFunc () // this is a method that does not exist in the interface {e Cho "Test" ;}}?>
I hope this article will help you with php programming.