Results 1 to 2 of 2

Thread: grab data crul?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    15

    grab data crul?

    I want to grab certion data from a curl request but cant find a way to make it work!
    So far i have this:
    PHP Code:
    <? 
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://www.google.com');
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $data = curl_exec($ch);
    echo $data;
    curl_close($ch);
     ?>
    this shows the web page but i dont want all the page only a part of it.

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: grab data crul?

    have you even tried to "make it work"? you can either loop through $data line by line and look for the line number you want, or use a regular expression to match the information you might be interested in. what exactly are you trying to take from this page?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width