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 code is as follows
代码如下 |
复制代码 |
similar_text($string1, $string2, $percent);
|
|
Copy code
|
| similar_text($string1, $string2, $percent);
Note: levenshtein() function is faster than similar_text() function. However, the similar_text() function provides more accurate results with fewer modifications required.
http://www.bkjia.com/PHPjc/632269.htmlwww.bkjia.comtrue
http: //www.bkjia.com/PHPjc/632269.htmlPHP provides a rarely used similar_text function, but this function is very useful for comparing two strings And return the percentage of similarity code as follows. Copy the code similar_te...
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