method_exists ( $object, $method_name );
它检查给定对象中是否存在类方法。
Sr.No | Parameter & Description |
---|---|
1 |
object(必需) 对象 |
2 |
method_name(必需) 方法名称。 |
如果method_name给定的方法已为给定对象定义,则返回true,否则返回false。
链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-method-exists.html
来源:LearnFk无涯教程网
<?php $directory=new Directory('.'); var_dump(method_exists($directory,'anything')); ?>
它将产生以下输出-
bool(false)
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)