Advertisement
Guest User

curl test php

a guest
Jul 9th, 2023
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2. $url = "https://google.com";
  3.  
  4.  
  5. $ch = curl_init();
  6. curl_setopt($ch, CURLOPT_URL,$url);
  7. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  8. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  9. curl_setopt($ch, CURLOPT_ENCODING, '');
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  11. $result = curl_exec($ch);
  12.  
  13. //Result
  14. echo $result;
  15.  
  16. //Error Display
  17. echo curl_error($ch);
  18. ?>
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement