jjzjj

commonwords

全部标签

php - 从搜索字符串 PHP 中删除常用词

好的,所以我有一串由空格分隔的单词,即$commonwords='a,an,and,I,it,is,do,does,for,from,go,how,the,etc';我收到了来自$_POST['searchquery']的搜索查询;我想从搜索字符串中删除任何常用词,最终我要寻找的是更简洁的关键字,然后我可以使用这些关键字来查询数据库。所以如果用户搜索“HowdoIsearchforfiles”删除所有常用词后,该字符串变为“搜索文件”。 最佳答案 这可行,但您必须将大写的“how”添加到您的$commonwords$commonwo

PHP print_r 只显示数组而不是纯文本

我再次寻求帮助。我找到了这个停用词脚本-我基本上从字符串中删除了所有常用词。tag’skeywordattributeisnotthepagerankpanaceaitoncewasbackintheprehistoricdaysofInternetsearch.Itwasabusedfartoomuchandlostmostofitscachet.Butthere’snoneedtoignorethetag.Takeadvantageofalllegitimateopportunitiestoscorekeywordcredit,evenwhenthepayoffisrelative