当前路径:fn.php <?php /** * Description: PhpStorm. * Author: yoby * DateTime: 2018/12/5 19:53 * Email:logove@qq.com * Copyright Yoby版权所有 */ define("APPID",""); define("APPS",""); if (!function_exists('dump')) { function dump($arr){ echo '<pre>'.print_r($arr,TRUE).'</pre>'; } } /* * POST或GET的curl请求 * $url 请求地址 * $data 请求数组 * */ function curl($url,$data = ''){ $ch = curl_init(); if (class_exists('\CURLFile')) { curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true); } else { if (defined('CURLOPT_SAFE_UPLOAD')) { curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); } } preg_match('/https:\/\//', $url) ? $ssl = TRUE : $ssl = FALSE; if ($ssl) { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); } curl_setopt($ch, CURLOPT_URL, $url); if (!empty($data)) { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $d = curl_exec($ch); curl_close($ch); return $d; } /* * 通过oauth2获取公众号用户信息 * $type snsapi_userinfo表示用户信息 snsapi_base表示openid获取 * */ function getoauth2($type='snsapi_base',$appid=APPID,$apps=APPS,$expired = '600') { $scheme = $_SERVER['HTTPS']=='on' ? 'https://' : 'http://'; ...
完整源码文件,请先购买后再查看
相关源码
- 设备管理系统2023-12-07
- 企业办公OA系统2023-12-07
- 网吧管理系统2023-12-06
- 基于SPRINGBOOT质量管理系统2023-12-06
- 家电销售网站2023-12-06
- 基于SPRINGBOOT小学教学辅助平台2023-12-05
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2023. 京ICP备09089570号 | 京公网安备11010702000869号
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2023. 京ICP备09089570号 | 京公网安备11010702000869号