Counting words on a html web page using php

前端 未结 5 694
难免孤独
难免孤独 2020-12-30 10:40

I need a PHP script which takes a URL of a web page and then echoes how many times a word is mentioned.

Example

This is a generic HTML page:

5条回答
  •  一生所求
    2020-12-30 11:08

    The previous code is a point where start. The next step is delete html tags with the regular expressions. Look for ereg and eregi functions. Some other tricks are required for style and script tags (you have to remove the content) Points and commas have to be removed too...

提交回复
热议问题