This question already has an answer here:
I need a script that will return a count of how many times a specified word appears on webpage. Does anyone know how to do this with PHP? The code will be like this:
<?php
$url="watever.com";
the script here
echo(result);
?>
I do have this little bit that just gives a count of how many times every word on the webpage appears but I am not quite sure how to modify it for just one word.
$str = file_get_contents('http://www.example.com/');
print_r(array_count_values(str_word_count(strip_tags(strtolower($str)), 1)));
</div>