Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用in_array带有阿拉伯语的函数... in_array ('من', $words)在 $words 真正包含的地方给出了 true من。
in_array
in_array ('من', $words)
من
but in_array('من', $stopWords)is given false 虽然它包含 من 这个词...
in_array('من', $stopWords)
print_r($stopWords);
给:
数组( [0] => من )
和print_r($words);
print_r($words);
可能是什么问题呢?
$stopWords[0] 是 'من',在 من 之前有一个空格。所以因为我必须处理真实的文本文件并将其反射到 $stopWords,我不能修改它.. 而不是那个.. 我正在使用 mb_strpos 来捕捉单词 'من' 在任何元素中的任何出现数组 $stopWords.. 就是这样...问题解决了..