_autoload终究是什么原理

WBOY
Release: 2016-06-13 11:48:40
Original
886 people have browsed it

__autoload到底是什么原理
听 说是自动加载,是不是说它是加载写__autoload的文件同级目录中的所有文件呢。好象是这个意思,不过看很多资料没有明确写,都是含糊其词的。
------解决方案--------------------
在你实例化某个类时,如果没有加载这个文件,会自动触发__autoload($classname)这个方法,在__autoload()这个方法里加载这个类

方法里面你需要include 这个类所在文件的地址

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!