|
...
|
...
|
@@ -119,6 +119,45 @@ if (!function_exists('http_get')) { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!function_exists('curl_get')) {
|
|
|
|
function curl_get($url,$is_array=true)
|
|
|
|
{
|
|
|
|
$header = array(
|
|
|
|
'Expect:',
|
|
|
|
'Content-Type: application/json; charset=utf-8'
|
|
|
|
);
|
|
|
|
$ch = curl_init($url);
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
curl_setopt($ch, CURLOPT_HEADER, false);
|
|
|
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
|
|
|
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246');
|
|
|
|
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
|
|
|
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
|
|
|
|
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
|
|
|
|
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
|
|
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
|
curl_setopt($ch, CURLOPT_SSLVERSION, 'all');
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
|
|
|
$content = curl_exec($ch);
|
|
|
|
curl_close($ch);
|
|
|
|
return $is_array ? json_decode($content, true) : $content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :判断是否为俄语
|
|
|
|
* @name :contains_russian
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/6/5 10:38
|
|
|
|
*/
|
|
|
|
function contains_russian($text) {
|
|
|
|
// 使用正则表达式检查是否包含俄语字符
|
|
|
|
return preg_match('/[\x{0400}-\x{04FF}]/u', $text) > 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!function_exists('curl_c')) {
|
|
|
|
/**
|
|
|
|
* @param $url
|
|
...
|
...
|
@@ -148,7 +187,6 @@ if (!function_exists('curl_c')) { |
|
|
|
$content = curl_exec($ch);
|
|
|
|
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
|
|
|
|
curl_close($ch);
|
|
|
|
|
|
|
|
if($http_code == 200){
|
|
|
|
return $is_array ? json_decode($content, true) : $content;
|
|
|
|
}else{
|
...
|
...
|
|