levenshtein

int levenshtein (string string_one, string string_two, 
 [int insert_cost], [int substitution_cost], 
 [int delete_cost]) 
string_one First string to compare
string_two Second string to compare
insert_cost Cost of inserting a character
substitution_cost Cost of substituting a character
delete_cost Cost of deleting a character

Calculates the Levenshtein distance between two strings.

Returns:

Integer greater than zero (0); on error, an integer less than 0

Description:

levenshtein() is used to find the Levenshtein distance between two strings. The Levenshtein distance is defined as the fewest number of insert, substitution, and delete operations needed to transform one string into another string. The function is not case-sensitive. ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.