title: Data Fetch Using Php CUrl and Regular Expressions
body: <p>I wish to fetch information from one webpage using php curl, I am filtering data using php regular expression to match tag, but not working.</p>
  
  <p>here is webpage <a href="http://vikramshopping.com/reallife-3in1-printscriptcopy-5" rel="nofollow">click here</a></p>
  
  <p>here is my php code</p>
  
  <pre><code>if(preg_match('/&lt;div class="price-gruop"&gt;&lt;span class="text-price"&gt;Price:&lt;\/span&gt;(.*?)&lt;\/div&gt;/', get_page($url),$matches2))
          {
         $matches2[1] = strtolower($matches2[1]);
         $data['price']=$matches2[1];
  
          }
  
  function get_page($url){
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  //curl_setopt($ch, CURLOPT_PROXY, $proxy);
  curl_setopt($ch, CURLOPT_HEADER, 0); // return headers 0 no 1 yes
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return page 1:yes
  curl_setopt($ch, CURLOPT_TIMEOUT, 200); // http request timeout 20 seconds
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow redirects, need this if the url changes
  curl_setopt($ch, CURLOPT_MAXREDIRS, 2); //if http server gives redirection responce
  curl_setopt($ch, CURLOPT_USERAGENT,
      "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7");
  curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt"); // cookies storage / here the changes have been made
  curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // false for https
  curl_setopt($ch, CURLOPT_ENCODING, "gzip"); // the page encoding
  
  $data = curl_exec($ch); // execute the http request
  curl_close($ch); // close the connection
  return $data;
  }
  </code></pre>
  
  <p>I am getting string null value. please tell me how to get value in between tags.</p>