【php函数】调试函数

function  alert($data,$flag=true){
    header("Content-type: text/html; charset=utf-8");
    if(is_array($data)){
        echo"<pre>";
        print_r($data);
        echo"</pre>";
    }
    if(is_object($data)){
        $className=get_class($data);
        $class = new ReflectionClass($className);
        $properties = $class->getProperties();
        echo"<pre>";
        print_r($properties);
        echo"</pre>";
        $methods=$class->getMethods() ;
        echo"<pre>";
        print_r($methods);
        echo"</pre>";
    }else{
        if(is_string($data)){
            try {
                $class = new ReflectionClass($data);
                $properties = $class->getProperties();
                echo"<pre>";
                print_r($properties);
                echo"</pre>";
                $methods=$class->getMethods() ;
                echo"<pre>";
                print_r($methods);
                echo"</pre>";
            } catch (Exception $e) {
                echo"<pre>";
                var_dump($data);
                echo"</pre>";
            }
        }else{
            echo"<pre>";
            var_dump($data);
            echo"</pre>";
        }
    }
    if($flag){
        exit;
    }else{
    }
}


打赏

看恩吧
网站不承担任何有关评论的责任
  • 最新评论
  • 总共条评论
取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦