PHP CURL 在WHILE FOR 循环体中只执行一次

    xiaoxiao2021-03-25  121

    一般出现状况为:第一次请求成功返回,后面循环返回某个参数错误。被这问题坑的不行。最后通过在使用变量前unset解决。使用curl multi似乎也能解决该问题,未测试。

    unset($url); unset($todata); $url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=$access_token"; $todata = '{ "touser": "'.$orderDetail['jobid'].'", "toparty": "", "totag": "", "msgtype": "news", "agentid": "1", "news": { "articles":[ { "title": "兑换成功", "description": "", "url": "", "picurl": "" }, ] } }'; $this->https_request($url, $todata);
    转载请注明原文地址: https://ju.6miu.com/read-14819.html

    最新回复(0)