Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. // cURL replacement for file_get_contents()
  2. // Safer alternative to enabling allow_url_fopen in php.ini :)
  3.  
  4. function file_get_contents_curl($url) {
  5. $ch = curl_init();
  6. curl_setopt($ch, CURLOPT_HEADER, 0);
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  8. curl_setopt($ch, CURLOPT_URL, $url);
  9. $data = curl_exec($ch);
  10. curl_close($ch);
  11. return $data;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement