fork download
  1. <?php
  2. $ch = curl_init();
  3. curl_setopt($ch, CURLOPT_URL, "https://www.google.com");
  4. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  5. $response = curl_exec($ch);
  6. if(curl_errno($ch)){
  7. echo 'Curl error: ' . curl_error($ch);
  8. } else {
  9. echo 'Operation completed without any errors';
  10. }
  11. ?>
  12.  
Success #stdin #stdout 0.04s 26284KB
stdin
Standard input is empty
stdout
Curl error: Could not resolve host: www.google.com