Why can methods in the class be passed like this? What are instructions in the PHP manual? PHPcodeclassautoLoader {publicstaticfunctionmyLoader ($ classname) {$ class_filestrtolower ($ classname). & quot;. php & quot; why can methods in the class be passed like this? What are instructions in the PHP manual?
PHP code
Class autoLoader {public static function myLoader ($ classname) {$ class_file = strtolower ($ classname ). ". php "; if (file_exists ($ class_file) {require_once ($ class_file) ;}}// transmits classes and methods in the form of arrays, element 1 is the class name, element 2 is the method name // method is the static method spl_autoload_register (array ("autoLoader", "myLoader"); $ test = new Test ();
Where can classes and methods be transmitted in the form of arrays in the PHP manual?
PHP code
// Pass classes and methods in the form of arrays. element 1 is the class name and element 2 is the method name. // The method is the static method spl_autoload_register (array ("autoLoader ", "myLoader "));
------ Solution --------------------
Callback? Class (object) method name must be passed in this way, from php4
As for the manual, no instructions are provided. However, many php conventions are not described in the manual.
After all, the manual is not a textbook