Hi all,
over the last week, sometimes i was in need of a script that returns an array with keyword density data of any given URL.
I know there are many webservices to calculate the kd. But as i was not able to find a php class/function to do this, i wrote a simple yet powerfull php class myself.
Maybe it helps someone. So here it is:
code.eyecatch-up.de/?p=155
Usage is as simple as it comes:
Above example returns:
over the last week, sometimes i was in need of a script that returns an array with keyword density data of any given URL.
I know there are many webservices to calculate the kd. But as i was not able to find a php class/function to do this, i wrote a simple yet powerfull php class myself.
Maybe it helps someone. So here it is:
code.eyecatch-up.de/?p=155
Usage is as simple as it comes:
PHP:
<?php
include 'class/class.keywordDensity.php'; // Include class
$obj = new KD(); // New instance
$obj->domain = 'code.eyecatch-up.de'; // Define Domain
print_r ($obj->result());
?>
HTML:
Array
(
[0] => Array
(
[total words] => 231
)
[1] => Array
(
[keyword] => display
[count] => 14
[percent] => 6.06
)
and so on...
Last edited: