I want to retrieve the first 10k bytes from a URL with curl (using PHP in my case). Is there a way to specify this? I thought CURLOPT_BUFFERSIZE would do this, but it just a
If you use fread instead of curl, although I prefer curl, you can specify the size of the data you want to receive, for example:
$fp = @fopen($url, "r") ; $data = "" ; if($fp) { while (!feof($fp)) { $data .= fread($fp, $size) ; } fclose($fp) ;