fork download
  1. <?php
  2. $url = "https://www.google.com/";
  3.  
  4. $ch = curl_init();
  5. curl_setopt($ch, CURLOPT_URL, $url);
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  7.  
  8. // Optional: bypass SSL verify if needed (only for development, not production)
  9. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  10. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  11.  
  12. $response = curl_exec($ch);
  13.  
  14. if (curl_errno($ch)) {
  15. echo 'Curl error: ' . curl_error($ch);
  16. } else {
  17. echo $response;
  18. }
  19.  
  20.  
  21.  
  22.  
  23.  
  24. ?>
  25.  
Success #stdin #stdout 0.03s 26484KB
stdin
Standard input is empty
stdout
Curl error: Could not resolve host: www.google.com