title: Selecting a specific div from a extern webpage using CURL
body: <p>Hi can anyone help me how to select a specific div from the content of a webpage.</p>
  
  <p>Let's say i want to get the div with <code>id="wrapper_content"</code> from webpage  <code>http://www.test.com/page3.php</code>.</p>
  
  <p>My current code looks something like this: (not working)</p>
  
  <pre><code>//REG EXP.
  $s_searchFor = '@^/.dont know what to put here..@ui';    
  
  //CURL
  $ch = curl_init();
  $timeout = 5; // set to zero for no timeout
  curl_setopt ($ch, CURLOPT_URL, 'http://www.test.com/page3.php');
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  if(!preg_match($s_searchFor, $ch))
  {
    $file_contents = curl_exec($ch);
  }
  curl_close($ch);
  
  // display file
  echo $file_contents;
  </code></pre>
  
  <p>So i'd like to know how i can use reg expressions to find a specific div and how to <strong>unset</strong> the rest of the webpage so that <code>$file_content</code> only contains the div.</p>