mirror of https://github.com/dnomd343/tgbot
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
393 B
15 lines
393 B
3 years ago
|
<?php
|
||
|
|
||
|
class Curl {
|
||
|
public function get($url, $timeOut = 30) { // curl模拟Get 默认30s超时
|
||
|
$curl = curl_init();
|
||
|
curl_setopt($curl, CURLOPT_URL, $url);
|
||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||
|
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeOut);
|
||
|
$content = curl_exec($curl);
|
||
|
curl_close($curl);
|
||
|
return $content;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|