When to use an interface or abstract class:
1, if you want to create a model, this model will be used by some closely related objects to use the abstract class. Interfaces are used if you want to create features that will be used by unrelated objects.
2, if the behavior must be inherited from multiple sources, using an interface, the PHP class can inherit multiple interfaces, but cannot extend multiple abstract classes
3, if you know that all classes share a common behavior implementation, use an abstract class and implement that behavior in it. Unable to implement behavior in interface
Namespaces: As the class library expands, it is possible to encounter a situation where two class libraries use the same class name. Because each class is required to have a unique name, it is not possible to use two classes of the same name in the same PHP script
PHP Export Excel:
Header ("Content-type:application/vnd.ms-excel");
Header ("Content-disposition:attachment;filename=downdata.xls");
Header ("Pragma:no-cache");
Header ("expires:0");
echo "aa/t/n";
echo "bb/t/n";
PHP page Jump:
Header ("Location:www.baidu.com");
Several basic concepts of OOP:
Encapsulation: A well-known interface separates the user from the internal workings of the actual application, and when an object (component) is used, it is only necessary to know the form of the interface he provides to the outside world, without having to know the details of his data structure and the algorithm that implements the operation.
Inheritance: Objects of a particular class have all the properties and methods of their generic classes.
Polymorphic: A subclass object can use the same name method as the object of the parent class, and the specific implementation of the method by the different self-class object is determined by itself.
PHP Knowledge Point 2