Parse error: syntax error, unexpected T_PUBLIC in 问题解决

class 类中

 public function _getInfo($sn){
        $title = '';
        $_array = explode('~', $sn);
        if(count($_array) > 0){
            $title = $_array[0];
        }
        return $title;
    }

提示下面错误:Parse error: syntax error, unexpected T_PUBLIC in

看错误提示一直以为是函数设置 public 有问题。最后查到问题竟然是在它上面的函数竟然是{}不匹配造成的。

好郁闷。

posted @ 2015-11-09 12:10  zhjahch  阅读(13677)  评论(2编辑  收藏  举报