<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Code The World — Similar text]]></title>
	<link rel="self" href="https://codetheworld.com/extern.php?action=feed&amp;tid=32&amp;type=atom" />
	<updated>2008-06-15T07:07:07Z</updated>
	<generator>PunBB</generator>
	<id>https://codetheworld.com/viewtopic.php?id=32</id>
		<entry>
			<title type="html"><![CDATA[Re: Similar text]]></title>
			<link rel="alternate" href="https://codetheworld.com/viewtopic.php?pid=70#p70" />
			<content type="html"><![CDATA[<p>Where&#039;s the similar_text($param1, $param2, $param3) function definition?</p>]]></content>
			<author>
				<name><![CDATA[3bep]]></name>
				<uri>https://codetheworld.com/profile.php?id=64</uri>
			</author>
			<updated>2008-06-15T07:07:07Z</updated>
			<id>https://codetheworld.com/viewtopic.php?pid=70#p70</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Similar text]]></title>
			<link rel="alternate" href="https://codetheworld.com/viewtopic.php?pid=43#p43" />
			<content type="html"><![CDATA[<p>This finds similar text between words.<br /></p><div class="codebox"><pre><code>$word2compare = &quot;stupid&quot;;
 
$words = array(
    &#039;stupid&#039;,
    &#039;stu and pid&#039;,
    &#039;hello&#039;,
    &#039;foobar&#039;,
    &#039;stpid&#039;,
    &#039;upid&#039;,
    &#039;stuuupid&#039;,
    &#039;sstuuupiiid&#039;,
);
 
while(list($id, $str) = each($words)){
    similar_text($str, $word2compare, $percent);
    print &quot;Comparing &#039;$word2compare&#039; with &#039;$str&#039;: &quot;;
    print round($percent) . &quot;%\n&quot;;
}
 
/*
Results:
 
Comparing &#039;stupid&#039; with &#039;stupid&#039;: 100%
Comparing &#039;stupid&#039; with &#039;stu and pid&#039;: 71%
Comparing &#039;stupid&#039; with &#039;hello&#039;: 0%
Comparing &#039;stupid&#039; with &#039;foobar&#039;: 0%
Comparing &#039;stupid&#039; with &#039;stpid&#039;: 91%
Comparing &#039;stupid&#039; with &#039;upid&#039;: 80%
Comparing &#039;stupid&#039; with &#039;stuuupid&#039;: 86%
Comparing &#039;stupid&#039; with &#039;sstuuupiiid&#039;: 71%
*/</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Rockers00]]></name>
				<uri>https://codetheworld.com/profile.php?id=24</uri>
			</author>
			<updated>2008-06-15T03:45:45Z</updated>
			<id>https://codetheworld.com/viewtopic.php?pid=43#p43</id>
		</entry>
</feed>
