Create interface
Create a file with the suffix php and name interface and add the php tag to the file.
Create two interface classes Jk1 and Jk2 in the page.
Related recommendations: "php Getting Started Tutorial"
Add methods jiekou1 and jiekou2 to each of the two interface classes. parameter.
Interface instantiation
Declare a class Slh and use implements to implement the two interfaces Jk1 and Jk2.
In class Slh, the methods jiekou1 and jiekou2 in the interface are indispensable, and the passed parameters are output.
Create an object and call the methods jiekou1 and jiekou2 in class Slh, and the passed parameters will be output respectively.
The above is the detailed content of How to build a php interface. For more information, please follow other related articles on the PHP Chinese website!