0
点赞
收藏
分享

微信扫一扫

通过url调用类的不同方法

ZSACH 2023-02-16 阅读 39


通过url调用类的不同方法
实例:
test.php?action=resetreset

if(isset($_GET["action"])&&!empty($_GET["action"])){
$action=new newsaction();
$action->{$_GET["action"]}();

}

/**
* 单例模式
**/
class newsaction
{
//
public function resetreset(){

var_dump(Db::name('user_info') ->find() );
}
}


举报

相关推荐

0 条评论