title: An error in PHP code
body: <p>this is extremely basic I'm sure but I haven't used PHP ever and thus finding it hard, a code that I am using is giving me an error and I'm unsure what I can do to fix it</p>
  
  <p><code></p>
  
  <pre><code>&lt;?php
  $query = 'dogs';
  $searches = 100; // number of results
  $start = 0;
  $pos = 1;
  while($start &lt; $searches)
      {
      $data = getPage('http://www.google.com/search?start=' . $start . '&amp;q=' . urlencode($query));
      preg_match_all("/\&lt;li class\=g\&gt;\&lt;h3 class\=\"r\"\&gt;\&lt;a href\=\"([^\&lt;\&gt;]*)\" class\=l\&gt;/",$data,$matches);
      for($x = 0; $x &lt; count($matches[1]); $x++)
          {
          echo '&lt;p&gt;' . $pos . ' ' . ($matches[1][$x]) . '&lt;/p&gt;';
          $pos++;
          }
      $start += 10;
      }
  ?&gt;
  </code></pre>
  
  <p></code></p>
  
  <p>Error:
  Call to undefined function getPage() on line 11</p>
  
  <p>Any help?</p>