Keyword density of the page

I am working on a project where I have to find out the keyword density of the page on the basis of URL of that page,But I am not aware actually how to begin? and also how can we create a PHP script which will fetch the keyword density of a web page.who can give me a train of thought.the more detail,the better.thanks in advance.

i have googled about this,but don’t find any clues or tutorial.there are always payed or live tool.

yeah,i need to create one by myself base on php.

If you have limited knowledge in PHP… I suggest looking for a tutorial on how to create one, if you can’t find any… I’d recommend downloading a premade one and looking through the code to learn how it works.


Do you need to create your own?

download the one linked above and check how their code works ?what’s the URL, the above url you refered is a commercial software,can’t support download.

Thats probably because most people who need the tool… look for the tool, not to create one - and those who are looking to create one, have the programming knowledge to create one.

If you don’t know how… download the one linked above and check how their code works… should give you an idea on how to create your own and how it functions :slight_smile:

runeveryday: load the page text in a variable, split it by spaces, count how many times each word is in your resulting array, strip out stop-words (like “the”), print on screen, ordered by the occurrence count descending, and there you go.

i know is the answer,but i am still confused,is there an example about it?thank you.

anyone can help me ?

read my post one more time, and make it in PHP :stuck_out_tongue:

In such a case you need to build your own function. But before that let me give you and idea about keyword density.

Keyword density is the percentage of the searched word to that of the total content of the page. Suppose you like to check the keyword density of PHP within this page. Now a variable ($a) within the function will check each string of the content within the page and if it find the exact match then it will increment a variable by one. In the same time another variable ($b) will increment for counting the total no. of words within the page. Now just the follow B*100[/B]

I am sure that you will find the desired result.