matching - Best way in php to find most similar strings? -
hell,
php has lot of string functions levenshtein, similar_text , soundex can compare strings similarity. http://www.php.net/manual/en/function.levenshtein.php
which best accuracy , performance?
similar_text has complexity o(max(n,m)**3) , levenshtein complexity of o(m*n), n , m lengths of strings, levenshtein should faster. both 100% accurate, in give same output same input, outputs each function differ. if using different measure of accuracy, you'll have create own comparison function.
Comments
Post a Comment