Grw::__check_istrue PHP Méthode

__check_istrue() public méthode

检测对象是否真并返回JSON
public __check_istrue ( $obj, $b )
$obj
$b
    function __check_istrue($obj, $b)
    {
        if ($obj) {
            $result = array('status' => 'success', 'back' => $b);
            echo json_encode($result);
            exit;
        } else {
            $result = array('status' => 'error');
            echo json_encode($result);
            exit;
        }
    }