我有句子,我想分成单词,然后用停用词表中的数据检查它们。我想计算相同数据的数量(总数)。但是,total 并没有给我相同数据的总数。如何总结我需要的数据?谢谢
$word ='temporal. the text mining in a evolutionary a theme patterns theme threads clustering';
$symbol = array(".", ",", "\\", "-", "\"", "(", ")", "<", ">", "?", ";", ":", "+", "%", "\r", "\t", "\0", "\x0B");
$cleanMeta = str_replace($symbol, " ", $word);
$key = strtolower($cleanMeta);
$key = explode(" ", trim($key));
foreach($key as $word_key){
$query = mysql_query ("SELECT COUNT(stoplist_word) AS total FROM tb_stopword WHERE stoplist_word = '$word_key'");
while ($row = mysql_fetch_array($query)) {
$row1 = $row['total'];
echo $row1;
}
}