码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-08-16 19:17:13      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:hit   font   span   top   sts   mil   src   判断   get   

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


如果我们要判断一个类是不是可以用,可以先使用class_exists函数来判断一下,下面来看几个例子。

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。

实例如下:

技术分享


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

标签:hit   font   span   top   sts   mil   src   判断   get   

原文地址:http://www.cnblogs.com/phpfudao/p/7375004.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!