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

请教如何计算中文交集

WBOY
Release: 2016-06-13 12:44:32
Original
961 people have browsed it

请问怎么计算中文交集?

本帖最后由 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 />
Copy after login


这样只能计算英文交集,中文在很多情况下不能识别交集...还有中英混合时
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template