Hi there,
Does anyone know of an available PHP function that takes a piece of text, with say a few hundreds of words long and produces an array of keywords? Ie. the most important, frequently occuring unique terms?
Thanks Philip
Hi there,
Does anyone know of an available PHP function that takes a piece of text, with say a few hundreds of words long and produces an array of keywords? Ie. the most important, frequently occuring unique terms?
Thanks Philip
No such function exists (would be magical if it did) but to start something off, you could do the following:
preg_replace
).$words[0]
).Something like this might do the trick:
$thestring = 'the most important, frequently occuring unique terms?';
$arrayofwords = explode(" ", $thestring);
echo print_r($arrayofwords);
Also you may replacement the comma "," for a blank, so you get clean keywords.
$thestring = 'the most important, frequently occuring unique terms?';
$cleaned_string = str_replace(",", "", "$thestring");
$arrayofwords = explode(" ", $cleaned_string);
echo print_r($arrayofwords);