Home  >  Article  >  Backend Development  >  php开发问题-class_exists

php开发问题-class_exists

WBOY
WBOYOriginal
2016-06-23 13:15:371134browse

        判断类是否存在的时候,提示错误信息 找不到文件  include(XXXXX.php): failed to open stream: No such file or directory

所有在使用class_exists时先要判断类的文件是否存在,代码如下:

file_exists('../xxxx/'.$class_name)&&class_exists($class_name)


Statement:
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