0 ? $day.'天' : ''; $hour = floor(($remain_time % (3600*24)) / 3600); $hour = $hour > 0 ? $hour.'小时' : ''; if($is_hour && $is_minutes) { $minutes = floor((($remain_time % (3600*24)) % 3600) / 60); $minutes = $minutes > 0 ? $minutes.'分钟' : ''; return $day.$hour.$minutes; } if($hour) { return $day.$hour; } return $day; } //获取全图片地址 $image_data function image_path($image_data){ if(empty($image_data)){ return $image_data; } if (strpos($image_data,'|')!==false){ $image_res = explode('|',$image_data); }elseif(strpos($image_data,',')!==false){ $image_res = explode(',',$image_data); }else{ $image_res = array($image_data); } return $image_res; } // 获取模板区域 function get_city_area() { $field=['id','pid','name']; $list=Db::table('store_area')->where('pid',0)->field($field)->select(); foreach ($list as $k=>&$v){ $v['children']= Db::table('store_area')->where('pid',$v['id'])->field($field)->select(); } return $list; } function http_curl($url,$type='get',$res='json',$arr=''){ $headers = array(); //根据API的要求,定义相对应的Content-Type array_push($headers, "Content-Type".":"."application/x-www-form-urlencoded; charset=UTF-8;application/json"); $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $type); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); $output = curl_exec($curl); curl_close($curl); if($res=='json'){ if($output === false){ //请求失败,返回错误信息 return curl_error($curl); }else{ //请求成功,返回信息 return json_decode($output,true); } } } // 获取物流信息 function get_delivery($send_no = 'JD0053309649641',$express_code=''){ error_reporting(E_ALL || ~E_NOTICE); $AppKey = 204008273; $AppSecret ='t9PavvfCeK5v2XidwyK5pWDp8b0hzMq4'; $AppCode ='47f640e3529d43e28365311a530db2b7';//开通服务后 买家中心-查看AppCode $host = "https://wuliu.market.alicloudapi.com";//api访问链接 $path = "/kdi";//API访问后缀 $method = "GET"; $body =''; $headers = array(); array_push($headers, "Authorization:APPCODE " . $AppCode); $querys = "no={$send_no}&type={$express_code}"; //参数写在这里 $url = $host . $path . "?" . $querys; $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); if (1 == strpos("$" . $host, "https://")) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); } $out_put = curl_exec($curl); $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); list($header, $body) = explode("\r\n\r\n", $out_put, 2); if ($httpCode == 200) { return json_decode($body,true)['result']; } else { return []; } } // 元石日志 function crystal_log($user_id,$crystal,$desc,$type,$rel_id=0) { $log_data = [ 'user_id' => $user_id, 'create_at' => date('Y-m-d H:i:s'), 'crystal' => $crystal, 'desc' => $desc, 'type' => $type, 'rel_id' => $rel_id, ]; Db::table('crystal_info')->insert($log_data); } /** * 判断是否为合法的身份证号码 * @param $mobile * @return int */ function isCreditNo($vStr){ $vCity = array( '11','12','13','14','15','21','22', '23','31','32','33','34','35','36', '37','41','42','43','44','45','46', '50','51','52','53','54','61','62', '63','64','65','71','81','82','91' ); if (!preg_match('/^([\d]{17}[xX\d]|[\d]{15})$/', $vStr)) return false; if (!in_array(substr($vStr, 0, 2), $vCity)) return false; $vStr = preg_replace('/[xX]$/i', 'a', $vStr); $vLength = strlen($vStr); if ($vLength == 18) { $vBirthday = substr($vStr, 6, 4) . '-' . substr($vStr, 10, 2) . '-' . substr($vStr, 12, 2); } else { $vBirthday = '19' . substr($vStr, 6, 2) . '-' . substr($vStr, 8, 2) . '-' . substr($vStr, 10, 2); } if (date('Y-m-d', strtotime($vBirthday)) != $vBirthday) return false; if ($vLength == 18) { $vSum = 0; for ($i = 17 ; $i >= 0 ; $i--) { $vSubStr = substr($vStr, 17 - $i, 1); $vSum += (pow(2, $i) % 11) * (($vSubStr == 'a') ? 10 : intval($vSubStr , 11)); } if($vSum % 11 != 1) return false; } return true; } // 实名认证 function user_certification($id_card,$name){ $host = "http://checkone.market.alicloudapi.com"; $path = "/chinadatapay/1882"; $method = "POST"; $appcode = "30be8bdcc65842919980a8276ffc4995"; $headers = array(); array_push($headers, "Authorization:APPCODE " . $appcode); //根据API的要求,定义相对应的Content-Type array_push($headers, "Content-Type".":"."application/x-www-form-urlencoded; charset=UTF-8"); $bodys = "idcard=".$id_card."&name=".$name; $url = $host . $path; $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); if (1 == strpos("$".$host, "https://")) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); } curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys); $res = curl_exec($curl); dump($res);die; if($res){ $res = json_decode($res,true); if($res['data']['result'] == 1){ return 1; }else{ return 0; } }else{ return 0; } } function shoucang(){ $host = "http://180.76.141.31:8888/cz/call"; $method = "POST"; $headers = array(); array_push($headers, "Content-Type".":"."application/json; charset=UTF-8"); $bodys = array( 'key' => 'test2', 'userkey' => '12344', 'product' => json_encode(array('name'=>'test','count'=>7)) ); $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $host); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); if (1 == strpos("$".$host, "https://")) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); } curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($bodys)); $res = curl_exec($curl); var_dump($res);exit(); } /** * 大师提前分钟数存入redis */ function setAdvanceMinutes(){ $redis = new \think\cache\driver\Redis(); $value = Db::name('system_config')->where('name','advance_minutes')->value('value'); $redis->set('advance_minutes',$value); } /** * 获取大师提前分钟数 */ function getAdvanceMinutes(){ $redis = new \think\cache\driver\Redis(); $value = $redis->get('advance_minutes'); if (empty($value)){ $value = Db::name('system_config')->where('name','advance_minutes')->value('value'); $redis->set('advance_minutes',$value); } return $value; } /** * 获取自动取消分钟数 */ function getCancelTime(){ return Db::name('system_config')->where('name','cancel_time')->value('value'); } /** * 用户信息存入redis hash */ function setMemberInfoHash($member_id){ $info = Db::name('store_member')->where('id',$member_id)->find(); $redis = new \think\cache\driver\Redis(); $array = ['member'.$member_id=>json_encode($info)]; $redis->hMSet('memberInfo',$array); } /** * redis获取用户信息 */ function getMemberInfoHash($member_id){ $redis = new \think\cache\driver\Redis(); $info = $redis->hGet('memberInfo','member'.$member_id); if (!$info){ $info = Db::name('store_member')->where('id',$member_id)->find(); $array = ['member'.$member_id=>json_encode($info)]; $redis->hMSet('memberInfo',$array); }else{ $info = json_decode($info,true); } return $info; } /** * 用户抢购卡数量存入redis 字符串 */ function setMembercard($member_id){ $snap_card = Db::name('store_member')->where('id',$member_id)->value('snap_card'); $redis = new \think\cache\driver\Redis(); $redis->set('membercard_'.$member_id,$snap_card); } /** * 获取用户抢购卡数量 */ function getMembercard($member_id){ $redis = new \think\cache\driver\Redis(); $count = $redis->get('membercard_'.$member_id); if (empty($count)){ $count = Db::name('store_member')->where('id',$member_id)->value('snap_card'); $redis->set('membercard_'.$member_id,$count); } return $count; } /** * 减掉用户抢购卡数量(减1) */ function loseMembercard($id){ $redis = new \think\cache\driver\Redis(); $redis->Decr('membercard_'.$id); } /** * 增加用户抢购卡数量(加1) */ function addMembercard($id){ $redis = new \think\cache\driver\Redis(); $redis->Incr('membercard_'.$id); } /** * 获取藏品库存 */ function getCollectionInventory($id){ $redis = new \think\cache\driver\Redis(); // $count = $redis->get('collection_count_'.$id); // if (empty($count)){ $count = Db::name('store_collection')->where('id',$id)->value('now_inventory'); $redis->set('collection_count_'.$id,$count); // } return $count; } /** * 减掉藏品库存 */ function loseCollectionInventory($id,$num){ $redis = new \think\cache\driver\Redis(); $redis->Decrby('collection_count_'.$id,$num); } /** * 加藏品库存 */ function addCollectionInventory($id,$num){ $redis = new \think\cache\driver\Redis(); $redis->Incrby('collection_count_'.$id,$num); } /** * 用户购买藏品排名更新 */ function saveRanking($id){ $redis = new \think\cache\driver\Redis(); $redis->Incr('ranking'.$id); } /** * 获取用户购买藏品排名更新 */ function getRanking($id){ $redis = new \think\cache\driver\Redis(); $count = $redis->get('ranking'.$id); if (empty($count)){ $redis->set('ranking'.$id,0); } $count = empty($count) ? 0 : $count; return $count; } /** * 藏品信息存入redis hash */ function setCollectionInfoHash($id){ $info = Db::name('store_collection')->where('id',$id)->find(); $redis = new \think\cache\driver\Redis(); $array = ['collection'.$id=>json_encode($info)]; $redis->hMSet('collectionInfo',$array); } /** * 获取用户购买数量 */ function getByCount($mid,$id){ $redis = new \think\cache\driver\Redis(); $count = $redis->get('UserByCount_'.$mid.$id); if (empty($count) && $count!=0){ // $count = Db::name('store_order') // ->where('mid',$mid) // ->where('c_id',$id) // ->whereIn('status','0,1') // ->sum('num'); // $count = $count ? $count : 0; $count = 0; $redis->Incrby('UserByCount_'.$mid.$id,$count); } return $count; } /** * 用户购买数量增加 */ function IncrByCount($mid,$id,$number){ $redis = new \think\cache\driver\Redis(); $redis->Incrby('UserByCount_'.$mid.$id,$number); } /** * 用户购买数量减少 */ function DecrByCount($mid,$id,$number){ $redis = new \think\cache\driver\Redis(); $redis->Decrby('UserByCount_'.$mid.$id,$number); } /** * 获取藏品hash redis长度 */ function getLenCollection($id){ $redis = new \think\cache\driver\Redis(); $count = $redis->Llen('collectionHash_'.$id); if (!$count){ $count = Db::name('hash') ->where('goods_id',$id) ->where('success',1) ->where('status',0) ->count(); } return $count; } /** * 获取藏品信息 */ function getCollectionInfoHash($id) { $redis = new \think\cache\driver\Redis(); $info = $redis->hGet('collectionInfo','collection'.$id); if (!$info){ $info = Db::name('store_collection')->where('id',$id)->find(); $array = ['collection'.$id=>json_encode($info)]; $redis->hMSet('collectionInfo',$array); }else{ $info = json_decode($info,true); } return $info; } /* * 微信支付账户 */ function retrunWxConfig(){ $config = [ 'app_id' => 'wxa79190389d57c04b', 'mch_id' =>'1623066512', 'key' =>'qwertyuiopASDFGHJKLZXCVBNM123456', ]; return $config; } /** * 获取离线账户 */ function getOfflineAccount(){ $url = 'http://192.144.219.204:8083/ddc/createAccount'; return file_get_contents($url); } /** * 获取链账户 */ function getWalletAddress($phone,$address){ $phone .= rand(10000,99999); $url = "http://192.144.219.204:8083/ddc/createAddress?name=".$phone."&account=".$address; $res=curlRequest($url); return json_decode($res,true); } /** * 获取公司生成的hash */ function getCompanyHash($id){ $redis = new \think\cache\driver\Redis(); $hash = $redis->lPop('collectionHash_'.$id); if (!$hash){ $hash = Db::name('hash')->where('goods_id',$id) ->where('status',0) ->order('id asc') ->field('hash,create_at') ->limit(1) ->find(); }else{ $hash = json_decode($hash,true); } return $hash; } /** * 获取排名 */ function getTag($id,$now,$num){ $len = strlen($num); $re = 'XX'.$id.'#'; switch ($len){ case 1: $re = $re.'0'.$now; break; case 2: if ($now<10){ $re = $re.'0'.$now; }else{ $re = $re.$now; } break; case 3: if ($now<10){ $re = $re.'00'.$now; }elseif ($now>=10 && $now<100){ $re = $re.'0'.$now; }else{ $re = $re.$now; } break; case 4: if ($now<10){ $re = $re.'000'.$now; }elseif ($now>=10 && $now<100){ $re = $re.'00'.$now; }elseif ($now>=100 && $now<1000){ $re = $re.'0'.$now; }else{ $re = $re.$now; } break; case 5: if ($now<10){ $re = $re.'0000'.$now; }elseif ($now>=10 && $now<100){ $re = $re.'000'.$now; }elseif ($now>=100 && $now<1000){ $re = $re.'00'.$now; }elseif ($now>=1000 && $now<10000){ $re = $re.'0'.$now; }else{ $re = $re.$now; } break; case 6: if ($now<10){ $re = $re.'00000'.$now; }elseif ($now>=10 && $now<100){ $re = $re.'0000'.$now; }elseif ($now>=100 && $now<1000){ $re = $re.'000'.$now; }elseif ($now>=1000 && $now<10000){ $re = $re.'00'.$now; }elseif ($now>=10000 && $now<100000){ $re = $re.'0'.$now; }else{ $re = $re.$now; } break; } $re = $re.'/'.$num; return $re; } /** * 判断藏品是否设置过提醒 */ function getRemind($mid,$c_id){ return Db::name('store_collection_remind')->where('mid',$mid)->where('c_id',$c_id)->count(); } /** * 变更会员积分等 * @param int $money 余额 * @param int $user_id 会员ID * @param string $memo 备注 */ function memberMoneyChange($num, $type , $m_id, $title, $pm = 0,$link_id=0) { $member = Db::name('store_member')->where('id',$m_id)->find(); switch ($type){ case 1: //积分 $before = $member['integral']; if ($pm==1) $after = $member['integral']+$num; else $after = $member['integral']-$num; $update_data = ['integral'=>$after]; break; case 2: //抢购卡 $before = $member['snap_card']; if ($pm==1) $after = $member['snap_card']+$num; else $after = $member['snap_card']-$num; $update_data = ['snap_card'=>$after]; break; } Db::startTrans(); try { Db::name('store_member')->where('id',$m_id)->update($update_data); $data = [ 'm_id'=>$m_id, 'type'=>$type, 'pm'=>$pm, 'title'=>$title, 'change'=>$num, 'before'=>$before, 'after'=>$after, 'link_id'=>$link_id ]; Db::name('store_member_log')->insert($data); Db::commit(); return true; }catch (\Exception $e){ Db::rollback(); return false; } } /** * 获取单个系统配置信息 */ function getConfigValue($name){ return Db::name('system_config')->where('name',$name)->value('value'); } /** * 判断藏品状态 */ function checkCollectionState($id=''){ if ($id){ $info = Db::name('store_collection')->where('id',$id)->find(); if ($info['state']==1){ if ($info['now_inventory']==0){ Db::name('store_collection')->where('id',$info['id'])->update(['state'=>3]); } }else if($info['state']==2){ if (strtotime($info['sell_time'])<=time()){ Db::name('store_collection')->where('id',$info['id'])->update(['state'=>1]); } }else if($info['state']==3){ if ($info['now_inventory']>0){ Db::name('store_collection')->where('id',$info['id'])->update(['state'=>1]); } } }else{ $list = Db::name('store_collection') ->whereIn('state','1,2') ->where('is_deleted',0) ->select(); foreach ($list as &$v){ if ($v['state']==1){ if ($v['now_inventory']==0){ Db::name('store_collection')->where('id',$v['id'])->update(['state'=>3]); } }else{ if (strtotime($v['sell_time'])<=time()){ Db::name('store_collection')->where('id',$v['id'])->update(['state'=>1]); } } } } } /***********************************************人脸识别*****************************************************************/ /** * 获取accesstoken * @return mixed */ function getAccessToken(){ $appid_id =getFaceInfo()['appid']; $secret = getFaceInfo()['secret']; $grant_type = 'client_credential'; $version = '1.0.0'; $url = "https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/access_token?app_id=".$appid_id."&secret=".$secret."&grant_type=".$grant_type."&version=".$version; $result = curlRequest($url); $result = json_decode($result,true); if ($result['code']==0){ return $result; } echo $result['msg'];die; } /** * 获取api_ticket */ function getApiTicket($type,$userId=''){ $appid_id =getFaceInfo()['appid']; $access_token = getAccessToken()['access_token']; $version = '1.0.0'; $url = "https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/api_ticket?app_id=".$appid_id."&access_token=".$access_token."&type=".$type."&version=".$version; if ($type=='NONCE'){ $url .= "&user_id=".$userId; } $result = curlRequest($url); $result = json_decode($result,true); if ($result['code']==0){ return $result; } echo $result['msg'];die; } /** * 生成签名 */ function generateSign($userId){ $wbappid = getFaceInfo()['appid']; $version = '1.0.0'; $ticket = getApiTicket('SIGN')['tickets'][0]['value']; $nonce = get32Str(); // $array = ['wbappid'=>$wbappid, 'userId'=>"$userId",'nonce'=>$nonce, 'version'=>$version, 'ticket'=>$ticket]; $array = [$wbappid, "$userId",$nonce, $version, $ticket]; file_put_contents("signLog.txt", json_encode($array) . "\n" . "\n", FILE_APPEND); sort($array); $str=''; foreach ($array as $kk=>$vv){ $str .=$vv; } // echo $str;die; $result = strtoupper(sha1($str)); $res['sign'] = $result; $res['nonce'] = $nonce; $res['appid'] = $wbappid; return $res; } /** * 合作方后台上送身份信息 */ function getfaceid($name,$idNo,$userId){ $webankAppId = getFaceInfo()['appid']; $orderNo = get32Str(); $sign = generateSign($userId); $data = [ 'webankAppId'=>$webankAppId, 'orderNo'=>$orderNo, 'name'=>$name, 'idNo'=>$idNo, 'userId'=>"$userId", 'version'=>'1.0.0', 'sign'=>$sign['sign'], 'nonce'=>$sign['nonce'] ]; $headers = []; array_push($headers, "Content-Type".":"."application/json; charset=UTF-8"); $url = 'https://miniprogram-kyc.tencentcloudapi.com/api/server/getfaceid?orderNo='.$orderNo; $result = curlRequest($url,$headers,json_encode($data),'POST'); $result = json_decode($result,true); if ($result['code']==0){ $data = [ 'appid'=>$sign['appid'], 'userID'=>"$userId", 'sign'=>$sign['sign'], 'nonce'=>$sign['nonce'], 'sdksign'=>SdkSign($userId,$sign['nonce']), 'result'=>$result['result'], ]; return $data; } echo $result['msg'];die; } /** * 生成 SDK 接口调用步骤使用签名 */ function SdkSign($userId,$nonce){ $wbappid = getFaceInfo()['appid']; $version = '1.0.0'; $ticket = getApiTicket('NONCE',$userId)['tickets'][0]['value']; //$nonce = get32Str(); $array = [$wbappid, "$userId",$nonce, $version, $ticket]; file_put_contents("sdksignLog.txt", json_encode($array) . "\n" . "\n", FILE_APPEND); sort($array); $str=''; foreach ($array as $kk=>$vv){ $str .=$vv; } $result = strtoupper(sha1($str)); return $result; } function getFaceInfo(){ //正式 $date = [ 'appid'=>'IDAKcvCn', 'secret'=>'L1id3z5zROK8SVXg72ZyZXc8ziniYLKpOnIzN1gecrBaEMaKIlKrreyRGCLU2z4l' ]; //测试 // $date = [ // 'appid'=>'TIDA3uGO', // 'secret'=>'z41IysbEhRy5oR4Qs2kFfVkrufXIJMtsJOQ3eulkWwXwdKG772LSSiZsKKwfsv9n' // ]; return $date; } //将数组转成uri字符串 function formatBizQueryParaMap($paraMap, $urlencode) { $buff = ""; ksort($paraMap); foreach ($paraMap as $k => $v) { if($urlencode) { $v = urlencode($v); } // $buff .= strtolower($k) . "=" . $v . "&"; $buff .= $v; } if (strlen($buff) > 0) { $reqPar = substr($buff, 0, strlen($buff)-1); } return $reqPar; } /** * 生成32位随机数 */ function get32Str(){ $length = 32; $str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; $len = strlen($str)-1; $randstr = ''; for ($i=0;$i<$length;$i++) { $num=mt_rand(0,$len); $randstr .= $str[$num]; } return $randstr; } function get_order_sn(){ $order_id_main = date('YmdHis') . rand(10000000,99999999); $order_id_len = strlen($order_id_main); $order_id_sum = 0; for($i=0; $i<$order_id_len; $i++){ $order_id_sum += (int)(substr($order_id_main,$i,1)); } $osn = $order_id_main . str_pad((100 - $order_id_sum % 100) % 100,2,'0',STR_PAD_LEFT); return $osn; } /** * 生成二维码 */ function setqrcode($value,$name){ $dir = dirname(realpath(dirname($_SERVER['SCRIPT_FILENAME']))) . '/public/user'; if(!file_exists($dir)){ //检查是否有该文件夹,如果没有就创建,并给予最高权限 mkdir($dir, 0700,true); } $filename = $dir.'/'.$name.'.png'; QRcode::png($value,$filename,QR_ECLEVEL_L,7); return 'http://'.$_SERVER['SERVER_NAME']."/user/".$name.'.png'; } //生成邀请二维码 function setintivecode($user_id){ $name = $user_id."_".time(); //$address = 'http://'.$_SERVER['SERVER_NAME'].'/build/#/'.$user_id; $address = 'http://www.baidu.com'; $url = setqrcode($address,$name); return $url; } /** * @param $url * @param array $headers * @param array $body * @param string $method * @return bool|string */ function curlRequest($url, $headers = [], $body = [], $method = "GET") { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);//设置请求头 curl_setopt($ch, CURLOPT_POSTFIELDS, $body);//设置请求体 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); //定义请求类型 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTP_VERSION, 'CURL_HTTP_VERSION_1_1'); $output = curl_exec($ch); curl_close($ch); return $output; }