[英]Keywords from String
有誰知道一個可用的PHP函數,該函數接受一段文本,說幾百個字長,並產生一組關鍵字? IE瀏覽器。 最重要,經常出現的唯一用語?
謝謝菲利普
沒有這樣的功能(如果確實如此,那將是神奇的),但是要開始做某事,您可以執行以下操作:
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);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.