fork download
  1. <?php
  2. $url2 = "https://a...content-available-to-author-only...m.xyz/api/user/mohammad";
  3. $url = "https://google.com";
  4.  
  5. $ch = curl_init();
  6.  
  7.  
  8. curl_setopt($ch, CURLOPT_HEADER, 1);
  9. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  10. curl_setopt($ch, CURLOPT_HTTPGET, 1);
  11. curl_setopt($ch, CURLOPT_URL, $url );
  12. curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false );
  13. curl_setopt($ch, CURLOPT_DNS_CACHE_TIMEOUT, 2 );
  14.  
  15.  
  16.  
  17. $response = curl_exec($ch);
  18.  
  19.  
  20. if (curl_errno($ch)) {
  21. echo 'cURL error: ' . curl_error($ch);
  22. } else {
  23.  
  24. echo $response;
  25. }
  26.  
  27.  
  28. ?>
  29.  
Success #stdin #stdout 0.03s 26176KB
stdin
Standard input is empty
stdout
cURL error: Could not resolve host: google.com