闲者博客 - 字符串 https://bk1314.com/tag/%E5%AD%97%E7%AC%A6%E4%B8%B2/ zh-CN Fri, 25 Feb 2022 18:57:11 +0800 Fri, 25 Feb 2022 18:57:11 +0800 PHP寻找两个字符串的相似性 https://bk1314.com/42.html https://bk1314.com/42.html Fri, 25 Feb 2022 18:57:11 +0800 飞鱼 [scode type="blue"]PHP 提供了一个极少使用的 similar_text 函数,但此函数非常有用,用于比较两个字符串并返回相似程度的百分比。[/scode]

<?php
    similar_text($string1, $string2, $percent);
    //$percent will have the percentage of similarity
?>
]]>
0 https://bk1314.com/42.html#comments https://bk1314.com/feed/tag/%E5%AD%97%E7%AC%A6%E4%B8%B2/