Please answer in detail.
Reply content:
Please answer in detail
Registering and loading is a function or method. When the program does not find a class, it will first access this method to load the corresponding class to the program according to its own rules.
The registration of automatic loading tells PHP which automatic loading method will be used, so that PHP will know which method to call for loading if no class is found.
You need to complete an automatic loading method, and then register the automatic method to tell PHP to call this method when the class cannot be found.
When registering the autoload method, you only need to input a callable resource, and the method or function accepts at most one required parameter.
That is to say, You need to implement an automatic loading method and then call spl_autoload_register (callable) to register it.