Home  >  Article  >  php教程  >  PHP similar_text string similarity comparison function

PHP similar_text string similarity comparison function

高洛峰
高洛峰Original
2017-01-03 14:02:591242browse

PHP provides a rarely used similar_text function, but this function is very useful for comparing two strings and returning the percentage of similarity. The following is how to use the similar_text () function:

similar_text($string1, $string2, $percent); 
//使用此函数后,我们从变量$percent 中获取刚比较的两个字符串的相似度百分比

For more articles related to PHP similar_text string similarity comparison function, please pay attention to the PHP Chinese website!

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