Update tools.php

1. Added proper closure of cURL handle after execution.
This commit is contained in:
Danii Saahir 2024-05-17 00:12:43 +08:00 committed by GitHub
parent 3a0f6e24fb
commit b30dbe21a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
?>