tools.php 325 B

123456789101112131415
  1. <?php
  2. function get_root_domain($url) {
  3. return parse_url($url, PHP_URL_HOST);
  4. }
  5. function request($url)
  6. {
  7. $ch = curl_init($url);
  8. curl_setopt($ch, CURLOPT_HEADER, false);
  9. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  10. $response = curl_exec($ch);
  11. return $response;
  12. }
  13. ?>