判断类是否存在函数class_exists用法分析

原文地址:判断类是否存在函数class_exists用法分析php


若是咱们要判断一个类是否是能够用,能够先使用class_exists函数来判断一下,下面来看几个例子。函数

bool class_exists ( string $class_name [, bool $autoload = true ] )this

此功能是否给定的类被定义检查。this function checks whether or not the given class has been defined.返回true,若是class_name是一个定义的类,不然返回false。spa

实例以下:orm

相关文章
相关标签/搜索