您的位置:首页 > 编程语言 > PHP开发

php 类中统一 调用方法处理

2016-07-06 11:23 405 查看
<?php
class Test
{
function funcDeal(){
$func_name=$_GET['func'];
if(!method_exists(__CLASS__,$func_name)){
die("非法请求!");
}
call_user_func(array(__CLASS__,$func_name));
}
function test(){
echo 'this is test';die;
}

}

$test=new Test();
$test->funcDeal();
die;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: