Home  >  Article  >  php教程  >  PHP similar_text 字符串的相似性比较函数

PHP similar_text 字符串的相似性比较函数

WBOY
WBOYOriginal
2016-06-06 20:34:051004browse

PHP寻找两个字符串的相似性的similar_text ()函数使用方法

PHP 提供了一个极少使用的 similar_text 函数,但此函数非常有用,用于比较两个字符串并返回相似程度的百分比,以下是similar_text () 函数的使用方法:
代码如下:
similar_text($string1, $string2, $percent);
//使用此函数后,我们从变量$percent 中获取刚比较的两个字符串的相似度百分比
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