Newer
Older
GoStats / Classes / Curl.php
root on 7 May 2019 689 bytes Initial commit
  1. <?php
  2. class curl {
  3. public function curlQuery() {
  4. $ch = curl_init();
  5.  
  6. curl_setopt($ch, CURLOPT_URL, $this->url);
  7. curl_setopt($ch, CURLOPT_HEADER, 0);
  8. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
  9. curl_setopt($ch, CURLOPT_RETURNTRANSFER, True);
  10. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  11. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  12. //curl_setopt($ch, CURLOPT_VERBOSE, true); // verbose mode for debugging
  13.  
  14. $json = curl_exec($ch);
  15.  
  16. curl_close($ch);
  17.  
  18. $array = json_decode($json, true);
  19. return $array;
  20. }
  21. }
  22. ?>
Buy Me A Coffee