September 2001
Intermediate to advanced
768 pages
32h 45m
English
int similar_text(string string_one, string string_two [variable $percent])
| string_one | First string to be compared |
| string_two | Second string to be compared |
| $percent | Variable to store the percentage similarity of the strings |
Calculates the similarity of two strings.
Returns:
Number of characters that match between the two strings
Description:
similar_text() calculates the similarity of two strings. The function returns the number of unique characters that appear in both strings. The function can store the percentage similarity of the strings in the optional $percent parameter.
Version:
PHP 3.0.7, PHP 4+ since 4.0b2
See also:
Faster (but less accurate) method to analyze the similarity of two strings:
levenshtein()
To generate ...
Read now
Unlock full access