/ Published in: PHP
URL: curl
just a basic curl function
Expand |
Embed | Plain Text
function curlGetFileContents($url) { $ch = curl_init(); $timeout = 0; // set to zero for no timeout curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); // take out the spaces of curl statement!! if (!$file_contents) { die; } curl_close($ch); return $file_contents; }
You need to login to post a comment.
