title: function to scrape page keywords , description and title?
body: <p>i wrote simple 3 functions to scrape titles , description and keywords of simple html page
  this is the first function to scrape titles</p>
  <pre><code>function getPageTitle ($url)
  {
      $content = $url;
      if (eregi(&quot;&lt;title&gt;(.*)&lt;/title&gt;&quot;, $content, $array)) {
          $title = $array[1];
          return $title;
      }
  }
  </code></pre>
  <p>and it works fine
  and those are 2 functions to scrape description and keywords and those not working</p>
  <pre><code>function getPageKeywords($url)
  {
      $content = $url; 
      if ( preg_match('/&lt;meta[\s]+[^&gt;]*?name[\s]?=[\s\&quot;\']+keywords[\s\&quot;\']+content[\s]?=[\s\&quot;\']+(.*?)[\&quot;\']+.*?&gt;/i', $content, $array)) { 
          $keywords = $array[1];  
          return $keywords; 
      }  
  }
  function getPageDesc($url)
  {
      $content = $url; 
      if ( preg_match('/&lt;meta[\s]+[^&gt;]*?name[\s]?=[\s\&quot;\']+description[\s\&quot;\']+content[\s]?=[\s\&quot;\']+(.*?)[\&quot;\']+.*?&gt;/i', $content, $array)) { 
          $desc = $array[1];  
          return $desc; 
      }  
  }
  </code></pre>
  <p>i know there may be something wrong with the preg_match line but i really don't know
  i tried it so much things but it doesn't work</p>