curl - max read size

Discussion in 'PHP' started by kuser, Aug 2, 2012.

  1. #1
    I know there is a max readirect i can setup for the curl connection , but is there a max read-size? I don't want to accidentaly read an 5MB page while i only wish for example to create a small bot to read the meta tags (incl;uding title) so only max first 1kb of a website
     
    kuser, Aug 2, 2012 IP
  2. ssmm987

    ssmm987 Member

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    3
    Trophy Points:
    43
    #2
    Use CURLOPT_RANGE.

    Something like this:
    
    curl_setopt($ch,"CURLOPT_RANGE","0-1000");
    
    PHP:
    You have to experiment with the range a bit, to see whatever satisfies your demand.
     
    ssmm987, Aug 2, 2012 IP