This script calculates how similar two strings of text are.
<?php
/*****************
--Text Similarity
--More PHP Scripts at
--http://icecaves.net/tags/php
*****************/
$string_one = "This script will calculate how many characters are similar in two strings. It also returns a percent of how much the strings are similar.";
$string_two = "Below you can see how many characters match in each string.";
$calculate = similar_text($string_one, $string_two, $percent);
$percent = round($percent, 2);
echo "<b>String One:</b> $string_one<br><b>String Two:</b> $string_two<br><b>Matching Characters:</b> $calculate<br><b>Percent:</b> $percent%\n";
?>Code Preview:
String One: This script will calculate how many characters are similar in two strings. It also returns a percent of how much the strings are similar.
String Two: Below you can see how many characters match in each string.
Matching Characters: 39
Percent: 39.8%
String Two: Below you can see how many characters match in each string.
Matching Characters: 39
Percent: 39.8%
Forum Board:

Comments
Other functions you an use to kinda find similarity are those that deal with pronunciations and special "rules".
Some other functions:
Metaphone
SoundEx
Levenshtein
These are great if you wanted to provide features like spelling suggestions or an advanced search.