收藏
回答

获取素材列表返回null?

$url = 'https://api.weixin.qq.com/cgi-bin//material/batchget_material?access_token='.$ACC_TOKEN;

$json = '{"type":"image","offset":"0","count":"5"}';

$ret = https_request($url,$json);

     header("content-type:text/html;charset=utf-8") ;

    $ret = json_decode($ret,true);

        var_dump($ret);die;

function https_request($url, $data=null)

{

   $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url);

    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $output = curl_exec($ch);

    curl_close($ch);

     return $output; }

回答关注问题邀请回答
收藏
登录 后发表内容
问题标签