Home > Backend Development > PHP Tutorial > php 自动加载 autoload()

php 自动加载 autoload()

WBOY
Release: 2016-06-20 12:30:39
Original
894 people have browsed it

```//这里是绝对路径set_include_path(implode(PATH_SEPARATOR, array(    realpath('/opt/www/wcms/lib'),    get_include_path())));```//这个方法```function __autoload($className){    //如果加这个检测, 因为此文件不在当前目录下,它就会检测不到文件存在,    //但include是能成功的        require_once $className . '.php';}$erpSer=new ERPService();$erpSer->batchDeliver();```
Copy after login

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