Created
          November 9, 2018 15:41 
        
      - 
      
- 
        Save CodeBrauer/6b85010d5aec34a93ff0470f051eeccf to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| function curl_get_contents($url) { | |
| if (!function_exists('curl_init')) { return file_get_contents($url); } // fallback | |
| $ch = curl_init(); | |
| $options = array( | |
| CURLOPT_CONNECTTIMEOUT => 1, | |
| CURLOPT_RETURNTRANSFER => true, | |
| CURLOPT_SSL_VERIFYPEER => false, | |
| CURLOPT_HEADER => false, | |
| CURLOPT_URL => $url, | |
| ); | |
| curl_setopt_array($ch, $options); | |
| $response = curl_exec($ch); | |
| curl_close($ch); | |
| return $response; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment