CURL组件被禁用"); } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connTimeOut); curl_setopt($ch, CURLOPT_TIMEOUT, $timeOut); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $ret = @curl_exec($ch); @curl_close( $ch ); return $ret; } /*配置公众号文章地址 一定严格按照以下形式地址进行,前面不要加HTTPS*/ $url='//mp.weixin.qq.com/s/67woQdnLynJXhpx1K-p1Nw'; /*配置公众号文章地址 一定严格按照地址进行,前面不要加HTTPS*/ $url='https://wqs.jd.com/ad/jump.shtml?curl=http://h5.m.jd.com/active/openappextend/switchpage.html?murl='.urlencode('//e-m.jd.com/refresh.html?refreshLink='.urlencode($url));; // $cfix = 'wx_tic_'.$url; // $c = new cache();$c->dirName = 'cache';$code = $c->readCache($cfix); // if(!$code){ $result = wget_curl("http://wq.jd.com/mjgj/link/GetOpenLink?callback=getOpenLink&rurl=".urlencode($url)); preg_match('/weixin:\/\/dl\/business\/\?ticket\=([a-z0-9]+)/i', $result, $ret); $code = @$ret[1]; // $c->writeCache($cfix,$code,20); // } ?>