title: How to display href in cURL using php
body: <p>I am learning Scrapping webpage, Earlier I used Simple HTML DOM Parser but it was too slow. So I chose cURL. I learning through Some blogs. Now I want to display the href between two tags.</p>
  
  <pre><code>&lt;?php
  class tagSpider
  {
  var $crl;
  var $html;
  var $binary; 
  var $url;
  
  function tagSpider()
  {
  $this-&gt;html = "";
  $this-&gt;binary = 0;
  $this-&gt;url = "";
  }
  
  function fetchPage($url)
  {
  $this-&gt;url = $url;
  if (isset($this-&gt;url)) {
  $this-&gt;ch = curl_init ();
  curl_setopt ($this-&gt;ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt ($this-&gt;ch, CURLOPT_URL, $this-&gt;url); 
  curl_setopt($this-&gt;ch, CURLOPT_FOLLOWLOCATION, true); 
  curl_setopt($this-&gt;ch, CURLOPT_BINARYTRANSFER, $this-&gt;binary); 
  $this-&gt;html = curl_exec($this-&gt;ch); 
  curl_close ($this-&gt;ch); 
  }
  }
  
  function parse_array($beg_tag, $close_tag)
  {
  preg_match_all("($beg_tag.*$close_tag)siU", $this-&gt;html, $matching_data); 
  return $matching_data[0];
  }
  }
  ?&gt;
  
  &lt;?php
  $urlrun="http://m4.cricbuzz.com/";
  $stag='&lt;span&gt;';
  $etag="&lt;/span&gt;";
  $tspider = new tagSpider();
  $tspider-&gt;fetchPage($urlrun);
  $linkarray = $tspider-&gt;parse_array($stag, $etag); 
  foreach ($linkarray as $result) {
  echo strip_tags($result, '&lt;br&gt;&lt;div&gt;');
  echo "&lt;br&gt;-&lt;br&gt;";
  }
  ?&gt; 
  </code></pre>
  
  <p>How to display the href using the same Program</p>