title: Counting words on a html web page using php
body: <p>I need a PHP script which takes a URL of a web page and then echoes how many times a word is mentioned.</p>
  
  <h2>Example</h2>
  
  <p><strong>This is a generic HTML page:</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;h1&gt; This is the title &lt;/h1&gt;
  &lt;p&gt; some description text here, &lt;b&gt;this&lt;/b&gt; is a word. &lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>This will be the PHP script:</strong></p>
  
  <pre><code>&lt;?php
  htmlurl="generichtml.com";
  the script here
  echo(result);
  ?&gt;
  </code></pre>
  
  <p>So the output will be a table like this:</p>
  
  <pre><code>WORDS       Mentions
  This        2
  is          2
  the         1
  title       1
  some        1
  description 1
  text        1
  a           1
  word        1
  </code></pre>
  
  <p>This is something like the search bots do when they are surfing the web, so, any idea of how to begin, or even better, do you have a PHP script which already does this?</p>