BlogPHP Raw CurlThe regular PHP file functions sometimes are too slow and inadequate. In such cases you can use the raw "curl" command, which is faster and more adaptable. 1. Get the Headers of Remote File using cURL/** * Gets the headers using * @param String $url * @return String */ function rawCurlGetHeaders($url) { $cmd = 'curl ' . $url . ' --head'; exec($cmd, $out); return $out; } 2. Download Remote File using cURLOn an average server a 120MB file will take about 20secs. Impressive.
|