谷徳美食网
您的当前位置:首页php如何判断类方法是否存在

php如何判断类方法是否存在

来源:谷徳美食网


php判断类是否存在

bool class_exists ( string $class_name [, bool $autoload = true ] ) 检查一个类是否已经定义,一定以返回true,否则返回false,例如:

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

更多相关知识,请访问PHP中文网!

显示全文