Home >Backend Development >PHP Tutorial >PHP怎么判断一个类已经存在?

PHP怎么判断一个类已经存在?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 14:16:03945browse

PHP 类

PHP怎么判断一个类已经存在?不用再加载了。

回复讨论(解决方案)

if (class_exists('MyClass')) {    $myclass = new MyClass();}

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