Login   Register  
PHP Classes
elePHPant
Icontem

File: example

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Marius Ciotlos  >  String Similarity  >  example  >  Download  
File: example
Role: Example script
Content type: text/plain
Description: example file
Class: String Similarity
Calculate the similarity of two text strings
Author: By
Last change:
Date: 2007-02-27 05:33
Size: 370 bytes
 

Contents

Class file image Download
<?php

include("StringMatch.php");

$string1 "this should be same the";
$string2 "this should be the same";
$length1 strlen($string1);
$length2 strlen($string2);
$limit 0.4;
$comparison = new StringMatch;
$result $comparison->fstrcmp ($string1$length1$string2$length2$limit);

echo 
"Strings match around: ".round(($result*100),2)."%";
?>