mirror of
https://github.com/Ahwxorg/Binternet.git
synced 2026-03-11 08:54:37 +00:00
Update tools.php
1. Added proper closure of cURL handle after execution.
This commit is contained in:
parent
3a0f6e24fb
commit
b30dbe21a1
1 changed files with 11 additions and 13 deletions
|
|
@ -1,15 +1,13 @@
|
|||
<?php
|
||||
function get_root_domain($url) {
|
||||
return parse_url($url, PHP_URL_HOST);
|
||||
}
|
||||
|
||||
function request($url)
|
||||
{
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$response = curl_exec($ch);
|
||||
|
||||
return $response;
|
||||
}
|
||||
function get_root_domain($url) {
|
||||
return parse_url($url, PHP_URL_HOST);
|
||||
}
|
||||
function request($url) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $response;
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in a new issue