<?php
/**
* 打印调试
* @param $var 打印内容
* @param int $exit 是否定制代码运行
*/
function dump($var, $exit = 0)
{
echo "<pre>";
var_dump($var);
if ($exit) {
exit;
}
}
/**
* 随机字符串
* @param $length 字符串长度
* @param bool $addSpecialChar 加不加入特殊字符串
* @return null|string
*/
function getRandChar($length, $addSpecialChar = false)
{
$str = null;
$strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
if ($addSpecialChar) {
$strPol .= '()`~!@#$%^&*-+=|{}[]:;\'<>,.?/';
}
$max = strlen($strPol) - 1;
for ($i = 0; $i < $length; $i++) {
$str .= $strPol[rand(0, $max)];
}
return $str;
}
/**
* 格式化数字,可以选择要不要四舍五入
* @param $num 传入的数字
* @param $length 保留几位小数
* @param bool $round true=四舍五入
* @return bool|string
*/
function createDecimal($num, $length, $round = true)
{
$pos = strpos($num, '.');
if ($pos === false) {
$type = "%." . $length . "f";
return sprintf($type, $num);
}
if ($round) {
$type = "%." . $length . "f";
return sprintf($type, $num);
} else {
return substr($num, 0, $pos + 1 + $length);
}
}
/**
* 得到Excel的列表头的AA,AB,AC...
* @param $num 需要多少列
* @return array
*/
function getExcelColumns($num)
{
$array = array();
for ($i = 0; $i < $num; $i++) {
$y = ($i / 26);
if ($y >= 1) {
$y = intval($y);
$array[$i] = chr($y + 64);
$array[$i] .= chr($i - $y * 26 + 65);
} else {
$array[$i] = chr($i + 65);
}
}
return $array;
}
/**
* PHP实现alert
* @param $Str 提示消息
* @param string $Type back=回退;reload=刷新;close=关闭;function=执行函数,该函数需要在js代码中已经定义;直接填写url地址,跳转到对应地址
* @param string $TopWindow 窗口(self|top) 或者函数名(函数需要在js中已经定义并且type='function')
* @param int $Tim 延时毫秒
*/
function phpAlert($Str = '', $Type = "back", $TopWindow = "", $Tim = 100)
{
echo "<script>" . chr(10);
if (!empty($Str)) {
echo "alert(\"\\n\\n{$Str}\\n\\n\");" . chr(10);
}
echo "function _r_r_(){";
$WinName = (!empty($TopWindow)) ? "top" : "self";
switch (StrToLower($Type)) {
case "back":
echo $WinName . ".history.go(-1);" . chr(10);
break;
case "reload":
echo $WinName . ".window.location.reload();" . chr(10);
break;
case "close":
echo "window.opener=null;window.close();" . chr(10);
break;
case "function":
echo "return {$TopWindow}()" . chr(10);
break;
Default:
if ($Type != "") {
echo "window.{$WinName}.location=('{$Type}');";
}
}
echo "}" . chr(10);
echo "setTimeout(\"_r_r_()\"," . $Tim . ");" . chr(10);
echo "</script>" . chr(10);
}
/**
* 得到用户真实IP(尽可能的)
* @return mixed
*/
function getRealUserIp()
{
$unknown = 'unknown';
if (!empty($_SERVER['HTTP_CLIENT_IP']) && strcasecmp($_SERVER['HTTP_CLIENT_IP'], $unknown)) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_FOR'], $unknown)) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED']) && strcasecmp($_SERVER['HTTP_X_FORWARDED'], $unknown)) {
$ip = $_SERVER['HTTP_X_FORWARDED'];
} elseif (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && strcasecmp($_SERVER['HTTP_X_CLUSTER_CLIENT_IP'], $unknown)) {
$ip = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_FORWARDED_FOR']) && strcasecmp($_SERVER['HTTP_FORWARDED_FOR'], $unknown)) {
$ip = $_SERVER['HTTP_FORWARDED_FOR'];
} elseif (!empty($_SERVER['HTTP_FORWARDED']) && strcasecmp($_SERVER['HTTP_FORWARDED'], $unknown)) {
$ip = $_SERVER['HTTP_FORWARDED'];
} elseif (!empty($_SERVER['REMOTE_ADDR']) && strcasecmp($_SERVER['REMOTE_ADDR'], $unknown)) {
$ip = $_SERVER['REMOTE_ADDR'];
} elseif (!empty($_SERVER['HTTP_VIA']) && strcasecmp($_SERVER['HTTP_VIA'], $unknown)) {
$ip = $_SERVER['HTTP_VIA'];
}
/**
* 处理多层代理的情况
* 或者使用正则方式:$ip = preg_match("/[\d\.]{7,15}/", $ip, $matches) ? $matches[0] : $unknown;
*/
if (false !== strpos($ip, ',')) $ip = substr($ip,0,strpos($ip, ','));
return $ip;
}
/**
* 判断是否为合法的身份证号码
* @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;
}
/**
* 检测数组维度
* @param $array 待检测数组
* @return array type=1-->1维数组;2--->2维数组
*/
function checkArrayDimensional($array)
{
$Int_Array = array(
'type' => 0,
'message' => ''
);
if (is_array($array)) {
foreach ($array as $v) {
if (is_array($v)) {
$Int_Array = array('type' => 2, 'message' => '检测为二维数组');
} else {
$Int_Array = array('type' => 1, 'message' => '检测为一维数组');
}
}
} else {
$Int_Array = array('type' => 3, 'message' => '检测为不是数组');
}
return $Int_Array;
}
/**
* 去除所有空格
* @param $str 待处理字符串
* @return mixed 返回的字符串
*/
function deleteSpace($str,$to="")
{
$search = array(" ", " ", "\n", "\r", "\t");
$replace = array($to, $to, $to, $to, $to);
return str_replace($search, $replace, $str);
}
/**
* 格式化空格到英制空格
* @param $str
* @param string $to
* @return string|string[]|null
*/
function formatSpaces($str,$to = ' '){
$normalizeChars = array(
chr(194) . chr(160)=>$to,
chr(227).chr(128)=> $to,
chr(226).chr(128).chr(172).chr(226).chr(128).chr(172).chr(30)=>$to
);
$str = deleteSpace($str,$to);// 解决方法1
$str = strtr($str,$normalizeChars);// 解决方法1
$str = preg_replace('/\xC2\xA0/is', $to, $str); // 解决方法2
return $str;
}
/**
* 去除字符串html标签
* @param $str 待处理字符串
* @param $tags 标签,可传入数组|字符串 如 array('script')|script
* @param bool $stripContent 标签内字符是否去掉
* @return null|string|string[]
*/
function strip_only($str, $tags, $stripContent = false)
{
$content = '';
if (!is_array($tags)) {
$tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
if (end($tags) == '') array_pop($tags);
}
foreach ($tags as $tag) {
if ($stripContent)
$content = '(.+</' . $tag . '[^>]*>|)';
$str = preg_replace('#</?' . $tag . '[^>]*>' . $content . '#is', '', $str);
}
return $str;
}
//php防注入和XSS攻击通用过滤.
//by qq:831937
$_GET && SafeFilter($_GET);
$_POST && SafeFilter($_POST);
$_COOKIE && SafeFilter($_COOKIE);
function SafeFilter(&$arr)
{
$ra = array('/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/', '/script/', '/javascript/', '/vbscript/', '/expression/', '/applet/', '/meta/', '/xml/', '/blink/', '/link/', '/style/', '/embed/', '/object/', '/frame/', '/layer/', '/title/', '/bgsound/', '/base/', '/onload/', '/onunload/', '/onchange/', '/onsubmit/', '/onreset/', '/onselect/', '/onblur/', '/onfocus/', '/onabort/', '/onkeydown/', '/onkeypress/', '/onkeyup/', '/onclick/', '/ondblclick/', '/onmousedown/', '/onmousemove/', '/onmouseout/', '/onmouseover/', '/onmouseup/', '/onunload/');
if (is_array($arr)) {
foreach ($arr as $key => $value) {
if (!is_array($value)) {
if (!get_magic_quotes_gpc()) //不对magic_quotes_gpc转义过的字符使用addslashes(),避免双重转义。
{
$value = addslashes($value); //给单引号(')、双引号(")、反斜线(\)与 NUL(NULL 字符)加上反斜线转义
}
$value = preg_replace($ra, '', $value); //删除非打印字符,粗暴式过滤xss可疑字符串
$arr[$key] = htmlentities(strip_tags($value)); //去除 HTML 和 PHP 标记并转换为 HTML 实体
} else {
SafeFilter($arr[$key]);
}
}
}
}
/**
* PHP解决XSS(跨站脚本攻击)的调用函数
* PHP跨站脚本漏洞补丁,去除XSS(跨站脚本攻击)的函数,把以下代码保存在function.php文件中,在需要防御的页面中include
* Enter description here ...
* @param unknown_type $val
*/
function RemoveXSS($val)
{
$val = preg_replace('/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/', '', $val);
$search = 'abcdefghijklmnopqrstuvwxyz';
$search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$search .= '1234567890!@#$%^&*()';
$search .= '~`";:?+/={}[]-_|\'\\';
for ($i = 0; $i < strlen($search); $i++) {
// ;? matches the ;, which is optional
// 0{0,7} matches any padded zeros, which are optional and go up to 8 chars
// @ @ search for the hex values
$val = preg_replace('/(&#[xX]0{0,8}' . dechex(ord($search[$i])) . ';?)/i', $search[$i], $val); // with a ;
// @ @ 0{0,7} matches '0' zero to seven times
$val = preg_replace('/(�{0,8}' . ord($search[$i]) . ';?)/', $search[$i], $val); // with a ;
}
// now the only remaining whitespace attacks are \t, \n, and \r
$ra1 = Array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');
$ra2 = Array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');
$ra = array_merge($ra1, $ra2);
$found = true; // keep replacing as long as the previous round replaced something
while ($found == true) {
$val_before = $val;
for ($i = 0; $i < sizeof($ra); $i++) {
$pattern = '/';
for ($j = 0; $j < strlen($ra[$i]); $j++) {
if ($j > 0) {
$pattern .= '(';
$pattern .= '(&#[xX]0{0,8}([9ab]);)';
$pattern .= '|';
$pattern .= '|(�{0,8}([9|10|13]);)';
$pattern .= ')*';
}
$pattern .= $ra[$i][$j];
}
$pattern .= '/i';
$replacement = substr($ra[$i], 0, 2) . '<x>' . substr($ra[$i], 2); // add in <> to nerf the tag
$val = preg_replace($pattern, $replacement, $val); // filter out the hex tags
if ($val_before == $val) {
// no replacements were made, so exit the loop
$found = false;
}
}
}
return $val;
}
/**
* 读取文件的行数内容,可用于大文件
* @param $file_path
* @param int $starline
* @param int $perPage
* @param string $open_mode
* @return array
*/
function getFileLine($file_path, $starline = 0, $perPage = 5, $open_mode = "rb+")
{
$content = [];
$fp = new SplFileObject($file_path, $open_mode);
$fp->seek($starline);
for ($i = 0; $i < $perPage; $i++) {
$content[] = $fp->current();
$fp->next();
if ($fp->eof()) break;
}
return $content;
}
/**
* 逐行读取文件 和SplFileObject占用内存相当
* @param $fileName
* @return Generator
*/
function readYieldFile($fileName)
{
$handle = fopen($fileName, "rb+");
$fileExtension = pathinfo($fileName, PATHINFO_EXTENSION);
while (!feof($handle)) {
if($fileExtension == 'csv'){
yield fgetcsv($handle);
}else{
yield fgets($handle);
}
}
fclose($handle);
}
/**
* 根据id生成唯一字符串
* @param $user_id
* @return string
*/
function createUnicodeCode($user_id)
{
static $source_string = 'E5FCDG3HQA4B1NOPIJ2RSTUV67MWX89KLYZ';
$num = $user_id;
$code = '';
while ($num > 0) {
$mod = $num % 35;
$num = ($num - $mod) / 35;
$code = $source_string[$mod] . $code;
}
if (empty($code[3]))
$code = str_pad($code, 4, '0', STR_PAD_LEFT);
return $code;
}
/**
* 根据字符串反推ID
* @param $code
* @return float|int
*/
function decodeUnicodeCode($code)
{
static $source_string = 'E5FCDG3HQA4B1NOPIJ2RSTUV67MWX89KLYZ';
if (strrpos($code, '0') !== false)
$code = substr($code, strrpos($code, '0') + 1);
$len = strlen($code);
$code = strrev($code);
$num = 0;
for ($i = 0; $i < $len; $i++) {
$num += strpos($source_string, $code[$i]) * pow(35, $i);
}
return $num;
}
/**
* 简单的得到N个工作日后的日期,没排除节假日,只计算了周末两天
* @param int $days
* @param null $startDate
* @return false|string
*/
function getWorkDay(int $days, $startDate = null)
{
static $endDay = '';
$startDate === null && $startDate = date('Y-m-d');
$addedDays = 0;
for ($i = 1; $i <= $days; ++$i) {
$endWeekDay = date('w', strtotime($startDate . '+' . $i . 'days'));
if ($endWeekDay === '6' || $endWeekDay === '0') {
++$addedDays;
}
}
if ($addedDays > 0) {
getWorkDay($addedDays, date('Y-m-d', strtotime($startDate . '+' . $days . 'days')));
} else {
$endDay = date('Y-m-d', strtotime($startDate . '+' . $days . 'days'));
}
if ($endDay != '') {
return $endDay;
}
}
/**
* 判断文字是否为utf8
*
* @param string $pstr 文字
* @return boolean
*/
function isUtf8($string)
{
if (
preg_match("/^([" . chr(228) . "-" . chr(233) . "]{1}[" . chr(128) . "-" . chr(191) . "]{1}[" . chr(128) . "-" . chr(191) . "]{1}){1}/", $string) == true ||
preg_match("/([" . chr(228) . "-" . chr(233) . "]{1}[" . chr(128) . "-" . chr(191) . "]{1}[" . chr(128) . "-" . chr(191) . "]{1}){1}$/", $string) == true ||
preg_match("/([" . chr(228) . "-" . chr(233) . "]{1}[" . chr(128) . "-" . chr(191) . "]{1}[" . chr(128) . "-" . chr(191) . "]{1}){2,}/", $string) == true
) {
return true;
} else {
return false;
}
}
/**
* 得到一年中的周信息
* @param $year 年
* @param int $weekStartDay 周开始
* @return mixed
*/
function getYearWeek($year, $weekStartDay = 7)
{
$yearStartDay = $year . "-01-01";
$startDayTimestamp = strtotime($yearStartDay);
$weekDayArr = [
1 => 'next Monday',
2 => 'next Tuesday',
3 => 'next Wednesday',
4 => 'next Thursday',
5 => 'next Friday',
6 => 'next Saturday',
7 => 'next Sunday',
];
if (intval(date('N', $startDayTimestamp)) != $weekStartDay) {
$yearWeekStartDay = strtotime($weekDayArr[$weekStartDay], $startDayTimestamp); //获取年第一周的日期
} else {
$yearWeekStartDay = $startDayTimestamp;
}
$yearFirstWeekDay = date("Y-m-d", $yearWeekStartDay); //获取年第一周的日期
for ($i = 1; $i <= 52; $i++) {
$j = $i - 1;
$perWeekStartDay = date("Y-m-d", strtotime("$yearFirstWeekDay $j week "));
$perWeekEndDay = date("Y-m-d", strtotime("$perWeekStartDay +6 days"));
$weekArray[$i] = [$perWeekStartDay, $perWeekEndDay];
}
return $weekArray;
}
/**
* @param $string --待檢測字符串或者數字
* @param bool $noMiddleLine --有沒有中划线
* @return bool
*/
function isDate($string, $hasMiddleLine = true)
{
if ($hasMiddleLine) {
$arr = explode('-', $string);
if (!isset($arr[0]) || !isset($arr[1]) || !isset($arr[2])) {
return false;
}
return checkdate((int)$arr[1], (int)$arr[2], (int)$arr[0]) ? true : false;
} else {
if (strlen($string) > 8) {
return false;
}
$year = substr($string, 0, 4);
$month = substr($string, 4, 2);
$day = substr($string, 6, 2);
return checkdate((int)$month, (int)$day, (int)$year) ? true : false;
}
}
/**
* 得到两个时间之间的间隔月份
*/
function getMonthBetweenTwoMonth($start, $end)
{
$months = [];
$start = date('Y-m-d', strtotime($start));
$end = date('Y-m-d', strtotime($end));
$start = new \DateTime($start);
$end = new \DateTime($end);
$interval = \DateInterval::createFromDateString('1 month');
$period = new \DatePeriod($start, $interval, $end);
foreach ($period as $dt) {
$months[] = $dt->format('Ym');
}
return $months;
}
/**
* 创建文件件
* @param $path
* @return bool
*/
function makeDirs($path)
{
if (!is_dir($path)) {
mkdir($path, 0777, true);
//上面创建后只是755权限,要是需要修改成777,加上下面这一行
chmod($path, 0777);
}
return is_dir($path);
}
/**
* 简单的sql语句生成
* @param $data
* @param $tableName
* @return string
*/
function buildSql($data, $tableName){
$now = date('Y-m-d H:i:s');
$sql = "insert into `{$tableName}` ";
$columns = [];
$values = [];
foreach ($data as $key => $value){
if($value){
$columns[] = "`{$key}`";
$values[] = "'{$value}'";
}
}
$columns = "(".implode(',',$columns).",`created_at`,`updated_at`)";
$values = " VALUES (".implode(',',$values).",'{$now}','{$now}')";
$sql .= $columns.$values;
return $sql;
}
/**
* 将对象转换为多维数组
*
**/
function objectToArray($d) {
if (is_object($d)) {
// Gets the properties of the given object
// with get_object_vars function
$d = get_object_vars($d);
}
if (is_array($d)) {
/*
* Return array converted to object
* Using __FUNCTION__ (Magic constant)
* for recursive call
*/
return array_map(__FUNCTION__, $d);
}
else {
// Return array
return $d;
}
}
/**
* 将多维数组转换为对象
*
**/
function arrayToObject($d) {
if (is_array($d)) {
/*
* Return array converted to object
* Using __FUNCTION__ (Magic constant)
* for recursive call
*/
return (object) array_map(__FUNCTION__, $d);
}
else {
// Return object
return $d;
}
}
/**
* 得到数组里面两个不重复的数字之和
* @param $array ['a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5]
* @param $count 2
* @return array
*/
function getSumFromArray($array, $count = 2)
{
if ($count > 2) {
$totalArr = [];
$left = $count - 1;
$arrayCall = $array;
foreach ($arrayCall as $key => $item) {
$pre = $item;
unset($arrayCall[$key]);
if ($left >= 2 && count($arrayCall) > 1) {
$arrays = getSumFromArray($arrayCall, $left);
foreach ($arrays as $arrayK => $arrayItem) {
array_unshift($arrayItem['key'], $key);
$totalArr[$arrayK] = ['key' => $arrayItem['key'], 'amount' => bcadd($pre, $arrayItem['amount'], 2)];
}
}
}
return $totalArr;
} elseif ($count == 2) {
$list = [];
$listK = 0;
foreach ($array as $column => $value) {
unset($array[$column]);
foreach ($array as $column1 => $value1) {
$list[$listK] = ['key' => [$column, $column1], 'value' => [$value, $value1], 'amount' => bcadd($value, $value1, 2)];
++$listK;
}
}
return $list;
} else {
return [];
}
}
function curl_send($url, $headers, $request, $method = 'POST')
{
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_POSTFIELDS => $request,
CURLOPT_RETURNTRANSFER => true,//获取的信息以文件流的形式返回,不直接输出
CURLOPT_HEADER => false,//不返回header部分
CURLOPT_ENCODING => '',//Accept-Encoding编码,支持"identity"/"deflate"/"gzip",空支持所有编码
CURLOPT_MAXREDIRS => 10,//指定最多的HTTP重定向的数量
CURLOPT_TIMEOUT => 0,//连接后等待时间,0不等待。如下载mp3
CURLOPT_FOLLOWLOCATION => true,//跟踪爬取重定向页面
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,//设置curl使用的HTTP协议
CURLOPT_SSL_VERIFYPEER => false,//禁止 cURL 验证对等证书
CURLOPT_SSL_VERIFYHOST => false//是否检测服务器的域名与证书上的是否一致
]);
$response = curl_exec($ch);
$response = json_decode($response, true);
curl_close($ch);
return $response;
}
functions备用,可以放在公共引入的地方,各种常用方法
于 2020-03-11 17:16:21 首次发布