I created a script which get a content of something web page but this script get full content (~25.000 characters). My script do it with 4 sites so finally I get 100.000 characters but I need only first 100 characters from every web page. How I can tell CURL to get only fisrt 100 characters and no more ? I think it will be faster solution because now I have to wait ~11 seconds. It's too much for me.
Here is my script:
$c = curl_init();
curl_setopt($c, CURLOPT_URL, 'https://example.com/index.php?id='.$part.'&asmp3=1&part='.$i.'&t='.get_miliseconds());
curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($c, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($c, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$code = curl_exec($c);
curl_close($c);
What I have to add to my script to get only first 100 characters as response?
Thanks.
EDIT:
No, it's not duplicate from this URL: How to partially download a remote file with cURL? . I don't download any FILE but content of web page... It's not the same. It's not binary file but HTML content. I tried with solution from this URL but it's doesn;t work.