数百語の長さのテキストを取り、キーワードの配列を生成する利用可能なPHP関数を知っている人はいますか?つまり。最も重要で、頻繁に発生する固有の用語は?
ありがとうフィリップ
そのような関数は存在しません(存在する場合は魔法のようになります)が、何かを始めるには、次のようにすることができます。
preg_replace
)。$words[0]
)。このような何かがトリックを行う可能性があります:
$thestring = 'the most important, frequently occuring unique terms?';
$arrayofwords = explode(" ", $thestring);
echo print_r($arrayofwords);
また、コンマ「、」を空白に置き換えて、クリーンなキーワードを取得することもできます。
$thestring = 'the most important, frequently occuring unique terms?';
$cleaned_string = str_replace(",", "", "$thestring");
$arrayofwords = explode(" ", $cleaned_string);
echo print_r($arrayofwords);