Gaoming13\WechatPhpSdk\Api::delete_group PHP Method

delete_group() public method

Examples: $api->delete_group(102); Result: [ null, { errcode: 0, errmsg: "ok" } ]
public delete_group ( integer $group_id ) : array(err,
$group_id integer
return array(err,
    public function delete_group($group_id)
    {
        $url = self::API_DOMAIN . 'cgi-bin/groups/delete?access_token=' . $this->get_access_token();
        $xml = sprintf('{"group":{"id":"%s"}}', $group_id);
        $res = HttpCurl::post($url, $xml, 'json');
        // 异常处理: 获取时网络错误
        if ($res === false) {
            return Error::code('ERR_POST');
        }
        // 判断是否调用成功
        if ($res->errcode == 0) {
            return array(null, $res);
        } else {
            return array($res, null);
        }
    }