为了账号安全,请及时绑定邮箱和手机立即绑定

为什么会报这个错Parse error: syntax error, unexpected '}' in D:\phpStudy\WWW\MVC\function.php on line 13 大神指点一下

<?php
    function C($name, $method){
        require_once('/libs/Controller/'.$name.'Controller.class.php');
        // $testController=new testController();
        // $testController->show();
        eval('$obj = new '.$name.'Controller();$obj->'.$method.'();')
        
        /* eval()函数调用简单但是不安全
           可用下面代码代替:
            $controller=$name.'Controller';
            $obj = new $controller;
            $obj->$mothod(); */
    }
    
    function M($name){
        require_once('/libs/Model/'.$name.'Model.class.php');
        //$testModel = new testModel();
        eval('obj = new '.$name.'Model();')
        return $obj;
        
        /* $model=$name.'Model';
            $obj = new $model(); */
    }
    
    function V($name){
        require_once('/libs/View/'.$name.'View.class.php');
        
        eval('$obj = new '.$name.'View();')
        return $obj;
    }
    
    function daddslashes($str){
        return (!get_magic_quotes_gpc())?addslashes($str):$str;
    }
            ?>

正在回答

2 回答

少了个结束符

0 回复 有任何疑惑可以回复我~

语法错误吧、你仔细看看


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

为什么会报这个错Parse error: syntax error, unexpected '}' in D:\phpStudy\WWW\MVC\function.php on line 13 大神指点一下

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信