Home >Backend Development >PHP Tutorial >请教如何计算中文交集

请教如何计算中文交集

WBOY
WBOYOriginal
2016-06-13 11:26:29870browse

请问怎么计算中文交集?

本帖最后由 kk86868058 于 2013-05-31 17:29:02 编辑
<br /><br />    function str_intersect($string1, $string2){<br />        $string1= str_split($string1);<br />        $string2= str_split($string2);<br />        return array_intersect($string1, $string2);<br />    }<br />


这样只能计算英文交集,中文在很多情况下不能识别交集...还有中英混合时
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn