Link to home
Start Free TrialLog in
Avatar of Octalys
Octalys

asked on

PHP what is the difference between levenshtein() and similar_text() in practical usage?

PHP what is the difference between levenshtein() and similar_text() in practical usage?
Avatar of moracca
moracca

similar_text will return the number of similar characters, whereas levenshtein will return the number of characters that would have to change in order to transform the first string into the second
sorry, I assume you meant passing the percent argument to levenshtein to perform the function of similar_text

in that case, from what I understand levenshtein() is faster than similar_text(). However, similar_text() will give you a more accurate result
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial