Hell,
PHP has a lot of string functions like levenshtein, similar_text and soundex that can compare strings for similarity. http://www.php.net/manual/en/function.levenshtein.php
Which is the best for accuracy and performance?
similar_text has a complexity O(max(n,m)**3) and levenshtein a complexity of O(m*n), where n and m are the lengths of the strings, so levenshtein should be much faster. Both are 100% accurate, in that they give the same output for the same input, but the outputs for each function will differ. If you are using a different measure of accuracy, you'll have to create your own comparison function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With