最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php判断类是否存在函数 class_exists
时间:2010-07-24 编辑:简简单单 来源:一聚教程网
//bool class_exists ( string $class_name [, bool $autoload = true ] )
//此功能是否给定的类被定义检查。this function checks whether or not the given class has been defined.
//返回true,如果class_name是一个定义的类,否则返回false。
//实例
代码如下 | 复制代码 |
if (class_exists('myclass')) { $myclass = new myclass(); } |
代码如下 | 复制代码 |
function __autoload($class) // check to see whether the include declared the class if (class_exists('myclass')) { |
-
上一个: ajax+php文件上传代码
-
下一个: php获取当前文件所有执行的函数和类
相关文章
- php method_exists 检测类中是否包括函数 04-14
- php 3D饼图类绘制类函数 06-03
- PHP导出数据超时的优化建议解读 10-31
- PHP之mysql位运算解析 10-31
- Laravel实现登录跳转功能解析 10-31
- php双向队列解读 10-31