Is it any function in PHP that check the % of similarity of two strings?
For example i have:
$string1=\"Hello how are you doing\"
$string2= \" hi,
In addition to Alex Siri's answer and according to the following article:
http://docstore.mik.ua/orelly/webprog/php/ch04_06.htm
PHP provides several functions that let you test whether two strings are approximately equal:
$string1="Hello how are you doing" ;
$string2= " hi, how are you";
SOUNDEX
if (soundex($string1) == soundex($string2)) {
echo "similar";
} else {
echo "not similar";
}
METAPHONE
if (metaphone($string1) == metaphone($string2)) {
echo "similar";
} else {
echo "not similar";
}
SIMILAR TEXT
$similarity = similar_text($string1, $string2);
LEVENSHTEIN
$distance = levenshtein($string1, $string2);