最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php method_exists()函数用法
时间:2022-06-24 19:48:46 编辑:袖梨 来源:一聚教程网
method_exists
(PHP 4, PHP 5, PHP 7)
method_exists — 检查类的方法是否存在
说明
bool method_exists ( mixed $object , string $method_name )
如果 method_name 所指的方法在 object 所指的对象类中已定义,则返回 TRUE,否则返回 FALSE。
| 代码如下 | 复制代码 |
|
class a { public function yy() { $obj = new a(); var_dump(method_exists($obj, ‘xx’)); 测试结果都为true class a { public function yy() { public function yy() { $obj = new a(); | |
以上语句报错。
例子
| 代码如下 | 复制代码 |
|
// 获取要运行的action // 加载controller文件 if ( isset($_GET['m']) ) { | |
相关文章
- 鹅鸭杀超级金水铃模式怎么玩 08-07
- 牧场物语风之繁华集市生日日期怎么看 08-07
- 口袋新旅途如何捕捉颓颓鹰 08-07
- DNF狄瑞吉版本女漫游加点攻略 08-07
- 鹅鸭杀士兵怎么玩 08-07
- DNF狄瑞吉版本协战师加点攻略 08-07