2

I want to cut connection to remote server once tag is closed, so I don't want to download full HTML page and waste process time on it. Is it possible with CURL and how to do it?

Nikola
  • 133
  • 1
  • 1
  • 6
  • 1
    try this? http://stackoverflow.com/questions/1342583/manipulate-a-string-that-is-30-million-characters-long/1342760#1342760 – Jake N Feb 04 '14 at 11:26

1 Answers1

2

look at this code

#codded by mohammad reza ashouri 
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/');
curl_setopt($ch, CURLOPT_RANGE, '0-500');
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
Ashouri
  • 906
  • 4
  • 19